mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Don't show Link to TOTP if not set up (#27585)
This commit is contained in:
@@ -37,6 +37,14 @@ func WebAuthn(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
hasTwoFactor, err := auth.HasTwoFactorByUID(ctx, ctx.Session.Get("twofaUid").(int64))
|
||||
if err != nil {
|
||||
ctx.ServerError("HasTwoFactorByUID", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["HasTwoFactor"] = hasTwoFactor
|
||||
|
||||
ctx.HTML(http.StatusOK, tplWebAuthn)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user