mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-11 06:29:29 +01:00
read device ID from SASL as well
This commit is contained in:
parent
48d654d60c
commit
90e697f454
@ -241,6 +241,9 @@ func authPlainHandler(server *Server, client *Client, mechanism string, value []
|
||||
// distinguish user/ident from account name
|
||||
if strudelIndex := strings.IndexByte(authcid, '@'); strudelIndex != -1 {
|
||||
authcid = authcid[:strudelIndex]
|
||||
if !client.registered {
|
||||
rb.session.deviceID = authcid[strudelIndex+1:]
|
||||
}
|
||||
}
|
||||
password := string(splitValue[2])
|
||||
err := server.accounts.AuthenticateByPassphrase(client, authcid, password)
|
||||
@ -294,6 +297,9 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
|
||||
// distinguish user/ident from account name
|
||||
if strudelIndex := strings.IndexByte(authzid, '@'); strudelIndex != -1 {
|
||||
authzid = authzid[:strudelIndex]
|
||||
if !client.registered {
|
||||
rb.session.deviceID = authzid[strudelIndex+1:]
|
||||
}
|
||||
}
|
||||
err = server.accounts.AuthenticateByCertFP(client, rb.session.certfp, authzid)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user