fix(ui): guard against nil session in CSRF middleware
The CSRF middleware assumes a session is always present in the request context, but the web session middleware skips session creation for static-asset routes (/js/*, /stylesheets/*, /icon/*, etc.). A POST request to any static path causes a nil-pointer panic when calling .CSRF() on the nil session. Add a nil check to return 400 Bad Request when no session is present.
F
Frederick Stempfle committed
2bc9f306e3872fc7dba7f01c9b058e843b3945a3
Parent: 681b00f
Committed by fguillot <323546+fguillot@users.noreply.github.com>
on 8/4/2026, 7:36:53 AM