Don't show Link to TOTP if not set up (#27585)

This commit is contained in:
JakobDev authored and GitHub committed 2023-10-11 20:12:54 +00:00
1 parent 1d155a43ad
commit 328da56a28
2 files changed
+13 -3

No files matched your search

+8
View File
@@ -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)
}