Don't show Link to TOTP if not set up (#27585)
This commit is contained in:
parent
1d155a43ad
commit
328da56a28
2 changed files with 13 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue