Switch to SameSiteLaxMode

This commit is contained in:
Melon 2024-02-15 14:44:25 +00:00
parent 37b5fcb1a5
commit 48135101cd
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
4 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ func (h *HttpServer) EditGet(rw http.ResponseWriter, _ *http.Request, _ httprout
Path: "/",
Expires: time.Now().Add(10 * time.Minute),
Secure: true,
SameSite: http.SameSiteStrictMode,
SameSite: http.SameSiteLaxMode,
})
pages.RenderPageTemplate(rw, "edit", map[string]any{
"ServiceName": h.conf.ServiceName,

View File

@ -19,7 +19,7 @@ func (h *HttpServer) Home(rw http.ResponseWriter, req *http.Request, _ httproute
Path: "/",
Expires: time.Now().Add(10 * time.Minute),
Secure: true,
SameSite: http.SameSiteStrictMode,
SameSite: http.SameSiteLaxMode,
})
if auth.IsGuest() {

View File

@ -162,7 +162,7 @@ func (h *HttpServer) setLoginDataCookie(rw http.ResponseWriter, authData UserAut
Path: "/",
Expires: time.Now().AddDate(1, 0, 0),
Secure: true,
SameSite: http.SameSiteStrictMode,
SameSite: http.SameSiteLaxMode,
})
return false
}

View File

@ -134,7 +134,7 @@ func NewHttpServer(conf Conf, db *database.DB, signingKey mjwt.Signer) *http.Ser
Path: "/",
MaxAge: -1,
Secure: true,
SameSite: http.SameSiteStrictMode,
SameSite: http.SameSiteLaxMode,
})
http.Redirect(rw, req, "/", http.StatusFound)