fix: do 2FA on OpenID connect

This commit is contained in:
Gusted 2025-08-22 23:17:22 +02:00 committed by Earl Warren
commit 90e974cd24
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 79 additions and 16 deletions

View file

@ -166,6 +166,14 @@ func WebAuthnLoginAssertionPost(ctx *context.Context) {
}
}
// Handle OpenID linking to user.
if oid, ok := ctx.Session.Get("twofaOpenID").(string); ok {
if err := user_model.AddUserOpenID(ctx, &user_model.UserOpenID{UID: user.ID, URI: oid}); err != nil {
ctx.ServerError("AddUserOpenID", err)
return
}
}
remember := ctx.Session.Get("twofaRemember").(bool)
redirect := handleSignInFull(ctx, user, remember, false)
if redirect == "" {