From 12602302f28478a9e4ef91e66f68347a4d76f8a6 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Tue, 25 Nov 2025 20:14:20 -0500 Subject: Fix infinite redirect hopefully --- cmd/web/handlers/login.go | 1 + cmd/web/middleware/auth.go | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'cmd') diff --git a/cmd/web/handlers/login.go b/cmd/web/handlers/login.go index 87684ba..f912977 100644 --- a/cmd/web/handlers/login.go +++ b/cmd/web/handlers/login.go @@ -150,6 +150,7 @@ func (ctx *loginContext) logout(w http.ResponseWriter, r *http.Request) { Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } diff --git a/cmd/web/middleware/auth.go b/cmd/web/middleware/auth.go index 911eb44..255f40f 100644 --- a/cmd/web/middleware/auth.go +++ b/cmd/web/middleware/auth.go @@ -4,6 +4,7 @@ import ( "database/sql" "log" "net/http" + "os" "time" ) @@ -27,6 +28,7 @@ func (auth *AuthMiddleware) CheckAndInvalidate(next http.HandlerFunc) http.Handl Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } @@ -48,6 +50,7 @@ func (auth *AuthMiddleware) CheckAndInvalidate(next http.HandlerFunc) http.Handl Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } @@ -61,6 +64,7 @@ func (auth *AuthMiddleware) CheckAndInvalidate(next http.HandlerFunc) http.Handl Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } @@ -90,6 +94,7 @@ func (auth *AuthMiddleware) Resolve(next http.HandlerFunc) http.HandlerFunc { Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } @@ -114,6 +119,7 @@ func (auth *AuthMiddleware) Resolve(next http.HandlerFunc) http.HandlerFunc { Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } @@ -130,6 +136,7 @@ func (auth *AuthMiddleware) Resolve(next http.HandlerFunc) http.HandlerFunc { Name: "paterissa_session_token", Value: "", Path: "/", + Domain: os.Getenv("serv"), MaxAge: -1, HttpOnly: true, } -- cgit v1.2.3