feat: 24hr cookie expiry

This commit is contained in:
Teajey 2024-05-06 20:15:08 +12:00
parent 1de4893f8e
commit f606164d88
Signed by: Teajey
GPG Key ID: 970E790FE834A713
1 changed files with 1 additions and 0 deletions

View File

@ -42,5 +42,6 @@ func (auth *AuthMiddleware) ExpectUser(r *http.Request) *db.User {
func NewAuthMiddleware(protectedHandler http.Handler, publicHandler http.Handler) *AuthMiddleware { func NewAuthMiddleware(protectedHandler http.Handler, publicHandler http.Handler) *AuthMiddleware {
store := sessions.NewCookieStore([]byte(env.Secret)) store := sessions.NewCookieStore([]byte(env.Secret))
store.Options.MaxAge = 86_400
return &AuthMiddleware{store, protectedHandler, publicHandler} return &AuthMiddleware{store, protectedHandler, publicHandler}
} }