Skip to content

Commit a6008ff

Browse files
Always set the XSRF-TOKEN cookie unless the endpoint is configured not to protect against forgery (not just for non-Inertia requests)
1 parent 74fab7c commit a6008ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/inertia_rails/controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Controller
1313
helper ::InertiaRails::Helper
1414

1515
after_action do
16-
cookies['XSRF-TOKEN'] = form_authenticity_token unless request.inertia? || !protect_against_forgery?
16+
cookies['XSRF-TOKEN'] = form_authenticity_token unless !protect_against_forgery?
1717
end
1818
end
1919

0 commit comments

Comments
 (0)