mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
load U2F js only on pages which need it (#11585)
* load U2F js only on pages which need it * Update templates/base/head.tmpl
This commit is contained in:
@@ -21,6 +21,7 @@ const (
|
||||
func Security(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("settings")
|
||||
ctx.Data["PageIsSettingsSecurity"] = true
|
||||
ctx.Data["RequireU2F"] = true
|
||||
|
||||
if ctx.Query("openid.return_to") != "" {
|
||||
settingsOpenIDVerify(ctx)
|
||||
@@ -68,7 +69,6 @@ func loadSecurityData(ctx *context.Context) {
|
||||
ctx.ServerError("GetU2FRegistrationsByUID", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["RequireU2F"] = true
|
||||
}
|
||||
|
||||
tokens, err := models.ListAccessTokens(models.ListAccessTokensOptions{UserID: ctx.User.ID})
|
||||
|
Reference in New Issue
Block a user