aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/auth/openid.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/auth/openid.go')
-rw-r--r--routers/web/auth/openid.go26
1 files changed, 7 insertions, 19 deletions
diff --git a/routers/web/auth/openid.go b/routers/web/auth/openid.go
index 3b1065189d..d34f4db7c0 100644
--- a/routers/web/auth/openid.go
+++ b/routers/web/auth/openid.go
@@ -17,7 +17,6 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/mcaptcha"
"code.gitea.io/gitea/modules/recaptcha"
- "code.gitea.io/gitea/modules/session"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/web"
@@ -232,27 +231,16 @@ func signInOpenIDVerify(ctx *context.Context) {
}
}
- if _, err := session.RegenerateSession(ctx.Resp, ctx.Req); err != nil {
- ctx.ServerError("RegenerateSession", err)
- return
- }
-
- if err := ctx.Session.Set("openid_verified_uri", id); err != nil {
- log.Error("signInOpenIDVerify: Could not set openid_verified_uri in session: %v", err)
- }
- if err := ctx.Session.Set("openid_determined_email", email); err != nil {
- log.Error("signInOpenIDVerify: Could not set openid_determined_email in session: %v", err)
- }
-
if u != nil {
nickname = u.LowerName
}
-
- if err := ctx.Session.Set("openid_determined_username", nickname); err != nil {
- log.Error("signInOpenIDVerify: Could not set openid_determined_username in session: %v", err)
- }
- if err := ctx.Session.Release(); err != nil {
- log.Error("signInOpenIDVerify: Unable to save changes to the session: %v", err)
+ if err := updateSession(ctx, nil, map[string]interface{}{
+ "openid_verified_uri": id,
+ "openid_determined_email": email,
+ "openid_determined_username": nickname,
+ }); err != nil {
+ ctx.ServerError("updateSession", err)
+ return
}
if u != nil || !setting.Service.EnableOpenIDSignUp || setting.Service.AllowOnlyInternalRegistration {