|
@@ -240,9 +240,10 @@ func authPlainHandler(server *Server, client *Client, mechanism string, value []
|
240
|
240
|
// see #843: strip the device ID for the benefit of clients that don't
|
241
|
241
|
// distinguish user/ident from account name
|
242
|
242
|
if strudelIndex := strings.IndexByte(authcid, '@'); strudelIndex != -1 {
|
243
|
|
- authcid = authcid[:strudelIndex]
|
|
243
|
+ var deviceID string
|
|
244
|
+ authcid, deviceID = authcid[:strudelIndex], authcid[strudelIndex+1:]
|
244
|
245
|
if !client.registered {
|
245
|
|
- rb.session.deviceID = authcid[strudelIndex+1:]
|
|
246
|
+ rb.session.deviceID = deviceID
|
246
|
247
|
}
|
247
|
248
|
}
|
248
|
249
|
password := string(splitValue[2])
|
|
@@ -296,9 +297,10 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
|
296
|
297
|
// see #843: strip the device ID for the benefit of clients that don't
|
297
|
298
|
// distinguish user/ident from account name
|
298
|
299
|
if strudelIndex := strings.IndexByte(authzid, '@'); strudelIndex != -1 {
|
299
|
|
- authzid = authzid[:strudelIndex]
|
|
300
|
+ var deviceID string
|
|
301
|
+ authzid, deviceID = authzid[:strudelIndex], authzid[strudelIndex+1:]
|
300
|
302
|
if !client.registered {
|
301
|
|
- rb.session.deviceID = authzid[strudelIndex+1:]
|
|
303
|
+ rb.session.deviceID = deviceID
|
302
|
304
|
}
|
303
|
305
|
}
|
304
|
306
|
err = server.accounts.AuthenticateByCertFP(client, rb.session.certfp, authzid)
|