Rails 7: Devise trying to access storage when it has been turned off

65 Views Asked by At

I am trying to use devise without it trying to write to the session store because I am using devise_jwt but no matter how I turn off sessions I keep getting this error:

ActionDispatch::Request::Session::DisabledSessionError - Your application has sessions disabled. To write to the session you must first configure a session store:

Inside /config/initializers/devise.rb I have tried this:

config.skip_session_storage = %i[http_auth params_auth]

But that does not stop the issue. In the config/environments/development.rb I have also tried to use this code:

config.session_store = :null_store

And in config/application.rb I have tried this:

config.session_store :disabled

All of which have not worked

1

There are 1 best solutions below

0
Sebastian Scholl On

There's a few forums on this. Try updating the config like so. There's several Devise modules you may still be using that rely on cookies/sessions.

config.session_store :cookie_store, key: '_interslice_session'
config.middleware.use ActionDispatch::Cookies
config.middleware.use config.session_store, config.session_options