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