mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-16 22:22:33 +00:00
fix: do 2FA on OpenID connect
This commit is contained in:
parent
9828aca733
commit
90e974cd24
6 changed files with 79 additions and 16 deletions
|
@ -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 == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue