csrf: Use "/" path

This commit is contained in:
Tom Wiesing 2023-12-02 09:06:11 +01:00
parent f8773df4cc
commit ef4ed86bc2
No known key found for this signature in database

View file

@ -129,6 +129,7 @@ func (server *Server) csrf() func(http.Handler) http.Handler {
var opts []csrf.Option
opts = append(opts, csrf.Secure(server.Config.HTTP.HTTPSEnabled()))
opts = append(opts, csrf.SameSite(csrf.SameSiteStrictMode))
opts = append(opts, csrf.Path("/"))
opts = append(opts, csrf.CookieName(CSRFCookie))
opts = append(opts, csrf.FieldName(CSRFCookieField))
return csrf.Protect(server.Config.CSRFSecret(), opts...)