Open
Description
In the after_action I get an error, where the cookie is null:
require_relative "inertia_rails"
require_relative "helper"
module InertiaRails
module Controller
extend ActiveSupport::Concern
included do
before_action do
# :inertia_errors are deleted from the session by the middleware
InertiaRails.share(errors: session[:inertia_errors]) if session[:inertia_errors].present?
end
helper ::InertiaRails::Helper
after_action do
cookies['XSRF-TOKEN'] = form_authenticity_token unless request.inertia? || !protect_against_forgery?
end
end
cookies['XSRF-TOKEN'] = form_authenticity_token unless request.inertia? || !protect_against_forgery?
Resulting in this error
undefined method `[]=' for nil:NilClass
Metadata
Metadata
Assignees
Labels
No labels