Bumped the cookie age to 30 days
This commit is contained in:
parent
b465899f85
commit
68a6169bc3
2 changed files with 10 additions and 3 deletions
|
|
@ -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("/")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue