set csrf.Path to / to have csrf across paths

This commit is contained in:
Zhi Wang 2022-01-26 10:43:15 -05:00
parent 0565e0309a
commit 614b63a76a

View File

@ -30,7 +30,7 @@ func StartWeb(fp *os.File, cmd []string, naked bool, port uint16) {
store := sessions.NewCookieStore([]byte(uniuri.NewLen(32)))
rt.Use(sessions.Sessions("witty-session", store))
csrfHttp := csrf.Protect([]byte(uniuri.NewLen(32)))
csrfHttp := csrf.Protect([]byte(uniuri.NewLen(32)), csrf.Path("/"))
csrfGin := adapter.Wrap(csrfHttp)
rt.Use(csrfGin)