From f606164d8836114e3d7dcd4c4214590e35e73c5a Mon Sep 17 00:00:00 2001 From: Teajey <21069848+Teajey@users.noreply.github.com> Date: Mon, 6 May 2024 20:15:08 +1200 Subject: [PATCH] feat: 24hr cookie expiry --- auth/auth.go | 1 + 1 file changed, 1 insertion(+) diff --git a/auth/auth.go b/auth/auth.go index 5915bf7..d41b5ab 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -42,5 +42,6 @@ func (auth *AuthMiddleware) ExpectUser(r *http.Request) *db.User { func NewAuthMiddleware(protectedHandler http.Handler, publicHandler http.Handler) *AuthMiddleware { store := sessions.NewCookieStore([]byte(env.Secret)) + store.Options.MaxAge = 86_400 return &AuthMiddleware{store, protectedHandler, publicHandler} }