Global CSRF

This commit is contained in:
julien committed 2026-10-27 09:02:11 +01:00
1 parent 82f8b28353
commit 189432811f
2 files changed
+2 -3

No files matched your search

+2 -1
View File
@@ -9,7 +9,7 @@ class Netig < Roda
plugin :public
plugin :default_headers, "Content-Type" => "text/html; charset=utf-8"
plugin :sessions, secret: ENV.fetch("SESSION_SECRET")
plugin :route_csrf
plugin :route_csrf, csrf_failure: :empty_403
plugin :hash_branches
plugin :flash
@@ -17,6 +17,7 @@ class Netig < Roda
route do |r|
r.public
check_csrf!
r.hash_branches
r.root do
-2
View File
@@ -11,8 +11,6 @@ class Netig
end
r.post "send" do
check_csrf!
form = ContactForm.new(r.params)
if form.spam?