Bumped the cookie age to 30 days

This commit is contained in:
Leon Mika 2025-03-30 11:00:35 +11:00
parent b465899f85
commit 68a6169bc3
2 changed files with 10 additions and 3 deletions

View file

@ -8,6 +8,10 @@ import (
"lmika.dev/lmika/hugo-cms/services/users"
)
const (
authCookieAge = 30 * 24 * 3600 // 30 days
)
type AuthHandler struct {
UserService *users.Service
}
@ -37,8 +41,9 @@ func (h *AuthHandler) Login(c fiber.Ctx) error {
}
c.Cookie(&fiber.Cookie{
Name: models.AuthCookieName,
Value: string(bts),
Name: models.AuthCookieName,
Value: string(bts),
MaxAge: authCookieAge,
})
return c.Redirect().To("/")
}