Procházet zdrojové kódy

read device ID from SASL as well

tags/v2.2.0-rc1
Shivaram Lingamneni před 4 roky
rodič
revize
90e697f454
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6
    0
      irc/handlers.go

+ 6
- 0
irc/handlers.go Zobrazit soubor

@@ -241,6 +241,9 @@ func authPlainHandler(server *Server, client *Client, mechanism string, value []
241 241
 	// distinguish user/ident from account name
242 242
 	if strudelIndex := strings.IndexByte(authcid, '@'); strudelIndex != -1 {
243 243
 		authcid = authcid[:strudelIndex]
244
+		if !client.registered {
245
+			rb.session.deviceID = authcid[strudelIndex+1:]
246
+		}
244 247
 	}
245 248
 	password := string(splitValue[2])
246 249
 	err := server.accounts.AuthenticateByPassphrase(client, authcid, password)
@@ -294,6 +297,9 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
294 297
 		// distinguish user/ident from account name
295 298
 		if strudelIndex := strings.IndexByte(authzid, '@'); strudelIndex != -1 {
296 299
 			authzid = authzid[:strudelIndex]
300
+			if !client.registered {
301
+				rb.session.deviceID = authzid[strudelIndex+1:]
302
+			}
297 303
 		}
298 304
 		err = server.accounts.AuthenticateByCertFP(client, rb.session.certfp, authzid)
299 305
 	}

Načítá se…
Zrušit
Uložit