janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
571 stars 40 forks source link

Add note to "JSON API" wiki page regarding Rails api mode #115

Closed unkmas closed 2 years ago

unkmas commented 2 years ago

If you using Rails in API-mode it doesn't use sessions by default. So json without jwt won't work, until you enable session store.

Maybe, you can consider adding something like this to wiki page:

Note: if your Rails app is in the api mode, you need to enable session store in your application.rb:

    config.session_store :cookie_store, key: '_your_app_api_session'
    config.middleware.use ActionDispatch::Cookies
    config.middleware.use config.session_store, config.session_options
janko commented 2 years ago

Good point, would you mind updating the wiki page? It's publicly editable 🙂

unkmas commented 2 years ago

Oh, I've missed notification about your answer. However, your wording is better, than mine. Thanks!