feat: add secure flags to cookie (#17)

This commit is contained in:
Ludvig Lundgren 2021-08-22 15:31:20 +02:00 committed by GitHub
parent 3aad067c5e
commit 5f69ae9380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,6 +44,9 @@ func (h authHandler) login(w http.ResponseWriter, r *http.Request) {
return
}
store.Options.Secure = true
store.Options.HttpOnly = true
store.Options.SameSite = http.SameSiteStrictMode
session, _ := store.Get(r, "user_session")
_, err := h.authService.Login(data.Username, data.Password)