Browse Source

Merge pull request #1138 from slingamn/deviceid

read device ID from SASL as well
tags/v2.2.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
4edf7516eb
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      irc/handlers.go

+ 6
- 0
irc/handlers.go View File

@@ -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
 	}

Loading…
Cancel
Save