From 90e697f454ad1fd35bad2f76885daf0cbaa11b6a Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 16 Jun 2020 04:57:49 -0400 Subject: [PATCH] read device ID from SASL as well --- irc/handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/irc/handlers.go b/irc/handlers.go index 3d558cfa..2804aeb8 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -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) }