diff options
author | Kamil DomaĆski <kamil@domanski.co> | 2021-01-20 22:17:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 21:17:46 +0000 |
commit | 26da20aa93b474b1bf47b2ab650e0252f88a41cd (patch) | |
tree | 53249840ebd77afce50cb124952349d778ca01dc /routers/user | |
parent | cb08248c33a9e0f57c1480d0289b632da5d77668 (diff) | |
download | gitea-26da20aa93b474b1bf47b2ab650e0252f88a41cd.tar.gz gitea-26da20aa93b474b1bf47b2ab650e0252f88a41cd.zip |
load U2F js only on pages which need it (#11585)
* load U2F js only on pages which need it
* Update templates/base/head.tmpl
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/setting/security.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/user/setting/security.go b/routers/user/setting/security.go index 787ac922ec..87e2ba1c02 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}) |