diff options
Diffstat (limited to 'routers/web/auth')
-rw-r--r-- | routers/web/auth/2fa.go | 4 | ||||
-rw-r--r-- | routers/web/auth/auth.go | 2 | ||||
-rw-r--r-- | routers/web/auth/oauth.go | 6 | ||||
-rw-r--r-- | routers/web/auth/webauthn.go | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/routers/web/auth/2fa.go b/routers/web/auth/2fa.go index 2aacf23037..4791b04313 100644 --- a/routers/web/auth/2fa.go +++ b/routers/web/auth/2fa.go @@ -68,7 +68,7 @@ func TwoFactorPost(ctx *context.Context) { if ok && twofa.LastUsedPasscode != form.Passcode { remember := ctx.Session.Get("twofaRemember").(bool) - u, err := user_model.GetUserByID(id) + u, err := user_model.GetUserByID(ctx, id) if err != nil { ctx.ServerError("UserSignIn", err) return @@ -146,7 +146,7 @@ func TwoFactorScratchPost(ctx *context.Context) { } remember := ctx.Session.Get("twofaRemember").(bool) - u, err := user_model.GetUserByID(id) + u, err := user_model.GetUserByID(ctx, id) if err != nil { ctx.ServerError("UserSignIn", err) return diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 565a15bc11..71a62bce65 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -747,7 +747,7 @@ func ActivateEmail(ctx *context.Context) { log.Trace("Email activated: %s", email.Email) ctx.Flash.Success(ctx.Tr("settings.add_email_success")) - if u, err := user_model.GetUserByID(email.UID); err != nil { + if u, err := user_model.GetUserByID(ctx, email.UID); err != nil { log.Warn("GetUserByID: %d", email.UID) } else if setting.CacheService.Enabled { // Allow user to validate more emails diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index 2b872178ca..3d70ca9a50 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -194,7 +194,7 @@ func newAccessTokenResponse(ctx stdContext.Context, grant *auth.OAuth2Grant, ser ErrorDescription: "cannot find application", } } - user, err := user_model.GetUserByID(grant.UserID) + user, err := user_model.GetUserByID(ctx, grant.UserID) if err != nil { if user_model.IsErrUserNotExist(err) { return nil, &AccessTokenError{ @@ -385,7 +385,7 @@ func AuthorizeOAuth(ctx *context.Context) { var user *user_model.User if app.UID != 0 { - user, err = user_model.GetUserByID(app.UID) + user, err = user_model.GetUserByID(ctx, app.UID) if err != nil { ctx.ServerError("GetUserByID", err) return @@ -1222,7 +1222,7 @@ func oAuth2UserLoginCallback(authSource *auth.Source, request *http.Request, res return nil, goth.User{}, err } if hasUser { - user, err = user_model.GetUserByID(externalLoginUser.UserID) + user, err = user_model.GetUserByID(request.Context(), externalLoginUser.UserID) return user, gothUser, err } diff --git a/routers/web/auth/webauthn.go b/routers/web/auth/webauthn.go index b60007bc03..965fc10fe7 100644 --- a/routers/web/auth/webauthn.go +++ b/routers/web/auth/webauthn.go @@ -49,7 +49,7 @@ func WebAuthnLoginAssertion(ctx *context.Context) { return } - user, err := user_model.GetUserByID(idSess) + user, err := user_model.GetUserByID(ctx, idSess) if err != nil { ctx.ServerError("UserSignIn", err) return @@ -91,7 +91,7 @@ func WebAuthnLoginAssertionPost(ctx *context.Context) { }() // Load the user from the db - user, err := user_model.GetUserByID(idSess) + user, err := user_model.GetUserByID(ctx, idSess) if err != nil { ctx.ServerError("UserSignIn", err) return |