From 81a6eaa5e4b484c8ec916b492e3b49f87a59bab2 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Fri, 12 Sep 2025 19:03:20 +0100 Subject: [PATCH] Changed the cookie store options to work locally --- src/README.md | 1 + src/cmd/server.go | 7 +++++++ src/vars.mk | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/README.md b/src/README.md index 5078b8b..cd5f3f0 100644 --- a/src/README.md +++ b/src/README.md @@ -26,6 +26,7 @@ There are many features to be implemented! - [X] API (not complete, but going) - [ ] Add more logging (and configure the logger) - [ ] Need to add many UTs +- [ ] Figure out how to distribute the database (the migrations and whatnot problems) - [ ] Need to think about where the authentication endpoints are its separation of concerns - [ ] Create an interface to get data from a QR code so that we can have both diff --git a/src/cmd/server.go b/src/cmd/server.go index 264a8de..3314951 100644 --- a/src/cmd/server.go +++ b/src/cmd/server.go @@ -83,6 +83,13 @@ func startWebserver() { // setRoutes(router) store := cookie.NewStore([]byte("secret")) + store.Options(sessions.Options{ + Path: "/", + MaxAge: int(time.Hour * 24), + HttpOnly: true, + Secure: false, + SameSite: http.SameSiteLaxMode, + }) router.Use(sessions.Sessions("mysessions", store)) // Set auth groups diff --git a/src/vars.mk b/src/vars.mk index 0dd875f..04dafb5 100644 --- a/src/vars.mk +++ b/src/vars.mk @@ -5,4 +5,4 @@ REQUIRED_VARS := registry repo $(foreach v,$(REQUIRED_VARS),\ $(if $(value $(v)),,$(error Variable '$(v)' is required but empty))) -tag = v0.0.83-alpha +tag = v0.0.91-alpha