aboutsummaryrefslogtreecommitdiff
path: root/cmd/web
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web')
-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,
}