From 9798347c00e2ac0328b0663b998c1c226d263dec Mon Sep 17 00:00:00 2001 From: Tyler Noblett Date: Thu, 15 Jun 2023 15:35:28 -0400 Subject: [PATCH] fix webauthn not working as second login (#836) --- backend/authschemes/webauthn/webauthn.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/authschemes/webauthn/webauthn.go b/backend/authschemes/webauthn/webauthn.go index 66fb13a8f..f063bd68c 100644 --- a/backend/authschemes/webauthn/webauthn.go +++ b/backend/authschemes/webauthn/webauthn.go @@ -216,8 +216,13 @@ func (a WebAuthn) BindRoutes(r chi.Router, bridge authschemes.AShirtAuthBridge) if err != nil { return nil, backend.WrapError("Unable to validate registration data", err) } + + rawSessionData := bridge.ReadAuthSchemeSession(r) + sessionData, _ := rawSessionData.(*webAuthNSessionData) + return nil, bridge.CreateNewAuthForUser(authschemes.UserAuthData{ UserID: byteSliceToI64(data.UserData.UserID), + AuthnID: sessionData.UserData.AuthnID, Username: data.UserData.UserName, JSONData: helpers.Ptr(string(encodedCreds)), })