diff --git a/routers/user/setting/security.go b/routers/user/setting/security.go index 787ac922ec4..87e2ba1c02e 100644 --- a/routers/user/setting/security.go +++ b/routers/user/setting/security.go @@ -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}) diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 3c2371f0e96..1dcaea8560a 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -36,7 +36,6 @@ HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}}, SimpleMDE: {{if .RequireSimpleMDE}}true{{else}}false{{end}}, Tribute: {{if .RequireTribute}}true{{else}}false{{end}}, - U2F: {{if .RequireU2F}}true{{else}}false{{end}}, NotificationSettings: { MinTimeout: {{NotificationSettings.MinTimeout}}, TimeoutStep: {{NotificationSettings.TimeoutStep}},