3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +01:00

Merge pull request #1139 from slingamn/tilt

fix bug introduced in #1138
This commit is contained in:
Shivaram Lingamneni 2020-06-16 02:11:19 -07:00 committed by GitHub
commit 250076a132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,9 +240,10 @@ func authPlainHandler(server *Server, client *Client, mechanism string, value []
// see #843: strip the device ID for the benefit of clients that don't // see #843: strip the device ID for the benefit of clients that don't
// distinguish user/ident from account name // distinguish user/ident from account name
if strudelIndex := strings.IndexByte(authcid, '@'); strudelIndex != -1 { if strudelIndex := strings.IndexByte(authcid, '@'); strudelIndex != -1 {
authcid = authcid[:strudelIndex] var deviceID string
authcid, deviceID = authcid[:strudelIndex], authcid[strudelIndex+1:]
if !client.registered { if !client.registered {
rb.session.deviceID = authcid[strudelIndex+1:] rb.session.deviceID = deviceID
} }
} }
password := string(splitValue[2]) password := string(splitValue[2])
@ -296,9 +297,10 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
// see #843: strip the device ID for the benefit of clients that don't // see #843: strip the device ID for the benefit of clients that don't
// distinguish user/ident from account name // distinguish user/ident from account name
if strudelIndex := strings.IndexByte(authzid, '@'); strudelIndex != -1 { if strudelIndex := strings.IndexByte(authzid, '@'); strudelIndex != -1 {
authzid = authzid[:strudelIndex] var deviceID string
authzid, deviceID = authzid[:strudelIndex], authzid[strudelIndex+1:]
if !client.registered { if !client.registered {
rb.session.deviceID = authzid[strudelIndex+1:] rb.session.deviceID = deviceID
} }
} }
err = server.accounts.AuthenticateByCertFP(client, rb.session.certfp, authzid) err = server.accounts.AuthenticateByCertFP(client, rb.session.certfp, authzid)