aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-11-25 20:14:20 -0500
committerSamuel Johnson <[email protected]>2025-11-25 20:14:20 -0500
commit12602302f28478a9e4ef91e66f68347a4d76f8a6 (patch)
treea5b945a8bb0efb7969967e0c6f083e3eb7f24938
parent3c237fc659c2829042407697ca7aa3e1442a5719 (diff)
Fix infinite redirect hopefully
-rw-r--r--cmd/web/handlers/login.go1
-rw-r--r--cmd/web/middleware/auth.go7
2 files changed, 8 insertions, 0 deletions
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,
}