diff options
Diffstat (limited to 'routers/web/user/setting/security/security.go')
-rw-r--r-- | routers/web/user/setting/security/security.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/user/setting/security/security.go b/routers/web/user/setting/security/security.go index 67bbbf8b31..a87012c480 100644 --- a/routers/web/user/setting/security/security.go +++ b/routers/web/user/setting/security/security.go @@ -43,7 +43,7 @@ func DeleteAccountLink(ctx *context.Context) { if id <= 0 { ctx.Flash.Error("Account link id is not given") } else { - if _, err := user_model.RemoveAccountLink(ctx.User, id); err != nil { + if _, err := user_model.RemoveAccountLink(ctx.Doer, id); err != nil { ctx.Flash.Error("RemoveAccountLink: " + err.Error()) } else { ctx.Flash.Success(ctx.Tr("settings.remove_account_link_success")) @@ -56,28 +56,28 @@ func DeleteAccountLink(ctx *context.Context) { } func loadSecurityData(ctx *context.Context) { - enrolled, err := auth.HasTwoFactorByUID(ctx.User.ID) + enrolled, err := auth.HasTwoFactorByUID(ctx.Doer.ID) if err != nil { ctx.ServerError("SettingsTwoFactor", err) return } ctx.Data["TOTPEnrolled"] = enrolled - credentials, err := auth.GetWebAuthnCredentialsByUID(ctx.User.ID) + credentials, err := auth.GetWebAuthnCredentialsByUID(ctx.Doer.ID) if err != nil { ctx.ServerError("GetWebAuthnCredentialsByUID", err) return } ctx.Data["WebAuthnCredentials"] = credentials - tokens, err := models.ListAccessTokens(models.ListAccessTokensOptions{UserID: ctx.User.ID}) + tokens, err := models.ListAccessTokens(models.ListAccessTokensOptions{UserID: ctx.Doer.ID}) if err != nil { ctx.ServerError("ListAccessTokens", err) return } ctx.Data["Tokens"] = tokens - accountLinks, err := user_model.ListAccountLinks(ctx.User) + accountLinks, err := user_model.ListAccountLinks(ctx.Doer) if err != nil { ctx.ServerError("ListAccountLinks", err) return @@ -109,7 +109,7 @@ func loadSecurityData(ctx *context.Context) { } ctx.Data["AccountLinks"] = sources - openid, err := user_model.GetUserOpenIDs(ctx.User.ID) + openid, err := user_model.GetUserOpenIDs(ctx.Doer.ID) if err != nil { ctx.ServerError("GetUserOpenIDs", err) return |