From 953a1e26e60199806f3abf8e65b24c2227accd41 Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Mon, 20 Jul 2026 11:02:34 -0400 Subject: [PATCH] fix: add Tauri origins to CSRF allowlist --- cmd/server/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index b2968ca..9ad8ab9 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -163,7 +163,10 @@ func main() { r.Group(func(r chi.Router) { r.Use(middleware.Session(sessionStore, cfg)) r.Use(middleware.RequireAuth) - r.Use(middleware.CSRFProtect(cfg.Host, cfg.Port, strings.Split(os.Getenv("DUMPSTER_CSRF_ORIGINS"), ","))) + r.Use(middleware.CSRFProtect(cfg.Host, cfg.Port, append( + strings.Split(os.Getenv("DUMPSTER_CSRF_ORIGINS"), ","), + "tauri://localhost", "http://tauri.localhost", "https://tauri.localhost", + ))) // Auth (protected: me, update profile) authHandler.RegisterProtectedRoutes(r)