aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJonathan Tran <jonnytran@gmail.com>2024-04-14 00:46:56 -0400
committerGitHub <noreply@github.com>2024-04-14 12:46:56 +0800
commitb18c04ebde94e23d97da4958173faea843d5344f (patch)
tree56b8cfd225e32f18e4e6f6774f64eae18a10e4bc /services
parentc77e8140bc2ac6521dbebfb77613dce2648bfcb8 (diff)
downloadgitea-b18c04ebde94e23d97da4958173faea843d5344f.tar.gz
gitea-b18c04ebde94e23d97da4958173faea843d5344f.zip
fix: Fix to delete cookie when AppSubURL is non-empty (#30375)
Cookies may exist on "/subpath" and "/subpath/" for some legacy reasons (eg: changed CookiePath behavior in code). The legacy cookie should be removed correctly. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Kyle D <kdumontnu@gmail.com>
Diffstat (limited to 'services')
-rw-r--r--services/auth/source/oauth2/store.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/auth/source/oauth2/store.go b/services/auth/source/oauth2/store.go
index 394bf99463..90fa965602 100644
--- a/services/auth/source/oauth2/store.go
+++ b/services/auth/source/oauth2/store.go
@@ -9,6 +9,7 @@ import (
"net/http"
"code.gitea.io/gitea/modules/log"
+ session_module "code.gitea.io/gitea/modules/session"
chiSession "gitea.com/go-chi/session"
"github.com/gorilla/sessions"
@@ -65,7 +66,7 @@ func (st *SessionsStore) Save(r *http.Request, w http.ResponseWriter, session *s
chiStore := chiSession.GetSession(r)
if session.IsNew {
- _, _ = chiSession.RegenerateSession(w, r)
+ _, _ = session_module.RegenerateSession(w, r)
session.IsNew = false
}