diff options
Diffstat (limited to 'routers/web/auth')
-rw-r--r-- | routers/web/auth/linkaccount.go | 2 | ||||
-rw-r--r-- | routers/web/auth/oauth.go | 4 | ||||
-rw-r--r-- | routers/web/auth/oauth_test.go | 4 | ||||
-rw-r--r-- | routers/web/auth/openid.go | 2 | ||||
-rw-r--r-- | routers/web/auth/password.go | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/routers/web/auth/linkaccount.go b/routers/web/auth/linkaccount.go index 47a0daa06d..865bcca152 100644 --- a/routers/web/auth/linkaccount.go +++ b/routers/web/auth/linkaccount.go @@ -59,7 +59,7 @@ func LinkAccount(ctx *context.Context) { ctx.Data["email"] = email if len(email) != 0 { - u, err := user_model.GetUserByEmail(email) + u, err := user_model.GetUserByEmail(ctx, email) if err != nil && !user_model.IsErrUserNotExist(err) { ctx.ServerError("UserSignIn", err) return diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index a11417da16..7de63dbe94 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -225,7 +225,7 @@ func newAccessTokenResponse(ctx stdContext.Context, grant *auth.OAuth2Grant, ser idToken.Name = user.GetDisplayName() idToken.PreferredUsername = user.Name idToken.Profile = user.HTMLURL() - idToken.Picture = user.AvatarLink() + idToken.Picture = user.AvatarLink(ctx) idToken.Website = user.Website idToken.Locale = user.Language idToken.UpdatedAt = user.UpdatedUnix @@ -286,7 +286,7 @@ func InfoOAuth(ctx *context.Context) { Name: ctx.Doer.FullName, Username: ctx.Doer.Name, Email: ctx.Doer.Email, - Picture: ctx.Doer.AvatarLink(), + Picture: ctx.Doer.AvatarLink(ctx), } groups, err := getOAuthGroupsForUser(ctx.Doer) diff --git a/routers/web/auth/oauth_test.go b/routers/web/auth/oauth_test.go index 5116b4fc71..62f723600d 100644 --- a/routers/web/auth/oauth_test.go +++ b/routers/web/auth/oauth_test.go @@ -69,7 +69,7 @@ func TestNewAccessTokenResponse_OIDCToken(t *testing.T) { assert.Equal(t, user.Name, oidcToken.Name) assert.Equal(t, user.Name, oidcToken.PreferredUsername) assert.Equal(t, user.HTMLURL(), oidcToken.Profile) - assert.Equal(t, user.AvatarLink(), oidcToken.Picture) + assert.Equal(t, user.AvatarLink(db.DefaultContext), oidcToken.Picture) assert.Equal(t, user.Website, oidcToken.Website) assert.Equal(t, user.UpdatedUnix, oidcToken.UpdatedAt) assert.Equal(t, user.Email, oidcToken.Email) @@ -87,7 +87,7 @@ func TestNewAccessTokenResponse_OIDCToken(t *testing.T) { assert.Equal(t, user.FullName, oidcToken.Name) assert.Equal(t, user.Name, oidcToken.PreferredUsername) assert.Equal(t, user.HTMLURL(), oidcToken.Profile) - assert.Equal(t, user.AvatarLink(), oidcToken.Picture) + assert.Equal(t, user.AvatarLink(db.DefaultContext), oidcToken.Picture) assert.Equal(t, user.Website, oidcToken.Website) assert.Equal(t, user.UpdatedUnix, oidcToken.UpdatedAt) assert.Equal(t, user.Email, oidcToken.Email) diff --git a/routers/web/auth/openid.go b/routers/web/auth/openid.go index f544b65356..aff2e5f780 100644 --- a/routers/web/auth/openid.go +++ b/routers/web/auth/openid.go @@ -197,7 +197,7 @@ func signInOpenIDVerify(ctx *context.Context) { log.Trace("User has email=%s and nickname=%s", email, nickname) if email != "" { - u, err = user_model.GetUserByEmail(email) + u, err = user_model.GetUserByEmail(ctx, email) if err != nil { if !user_model.IsErrUserNotExist(err) { ctx.RenderWithErr(err.Error(), tplSignInOpenID, &forms.SignInOpenIDForm{ diff --git a/routers/web/auth/password.go b/routers/web/auth/password.go index e546c77bc9..16628645d7 100644 --- a/routers/web/auth/password.go +++ b/routers/web/auth/password.go @@ -59,7 +59,7 @@ func ForgotPasswdPost(ctx *context.Context) { email := ctx.FormString("email") ctx.Data["Email"] = email - u, err := user_model.GetUserByEmail(email) + u, err := user_model.GetUserByEmail(ctx, email) if err != nil { if user_model.IsErrUserNotExist(err) { ctx.Data["ResetPwdCodeLives"] = timeutil.MinutesToFriendly(setting.Service.ResetPwdCodeLives, ctx.Locale) |