Open bnjtgly opened 2 years ago
Experiencing this too. Respective versions as stated in the original issue
Same here. Rails -v 7.0.2.3
Fixed this by using this temporary solution.
controller/concerns/rack_session_fix.rb
module RackSessionFix
extend ActiveSupport::Concern
class FakeRackSession < Hash
def enabled?
false
end
end
included do
before_action :set_fake_rack_session_for_devise
private
def set_fake_rack_session_for_devise
request.env['rack.session'] ||= FakeRackSession.new
end
end
end
controller/registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController include RackSessionFix ... end
Still happening, using versions:
Environment
Current behavior
Prior to the issue, I have a Rails 6.1.4 API only app and the devise is perfectly fine. After I upgraded to Rails 7.0.2 the
registrations_controller
causes an error now. I appreciate your help. Thank you.Getting the following error on a rails API only app's
registrations_controller.rb
."exception": "#<ActionDispatch::Request::Session::DisabledSessionError: Your application has sessions disabled. To write to the session you must first configure a session store>"
Expected behavior
Registration should be successful. As everything works perfectly before I upgraded to 7.0.2.