summaryrefslogtreecommitdiffstats
path: root/routers/user/auth_openid.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/auth_openid.go')
-rw-r--r--routers/user/auth_openid.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/user/auth_openid.go b/routers/user/auth_openid.go
index e79085e94d..967e8aad2d 100644
--- a/routers/user/auth_openid.go
+++ b/routers/user/auth_openid.go
@@ -20,6 +20,7 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/web"
+ "code.gitea.io/gitea/modules/web/middleware"
"code.gitea.io/gitea/services/mailer"
)
@@ -47,13 +48,13 @@ func SignInOpenID(ctx *context.Context) {
redirectTo := ctx.Query("redirect_to")
if len(redirectTo) > 0 {
- ctx.SetCookie("redirect_to", redirectTo, 0, setting.AppSubURL, "", setting.SessionConfig.Secure, true)
+ middleware.SetRedirectToCookie(ctx.Resp, redirectTo)
} else {
redirectTo = ctx.GetCookie("redirect_to")
}
if isSucceed {
- ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true)
+ middleware.DeleteRedirectToCookie(ctx.Resp)
ctx.RedirectToFirst(redirectTo)
return
}