pelargir / auto-session-timeout

Provides automatic session timeout in a Rails application.
MIT License
126 stars 63 forks source link

protect_from_forgery exceptions in auto_session_timeout method raises error with `raise_on_missing_callback_actions = true` #46

Closed gfmurphy closed 5 months ago

gfmurphy commented 8 months ago

Steps to reproduce

  1. Create rails 7.1.x app
  2. Ensure config.raise_on_missing_callback_actions = true set
  3. Add auto_session_timeout to controller
  4. Load a page

Expected results Page loads

Actual results Unknown action returned (404 status)

Notes

Question Since active and timeout are documented to require get method, can we remove the protect_from_forgery call altogether? Is it required for get? This would allow us to run application with raise_on_missing_callback_actions = true

pelargir commented 7 months ago

That's correct, protect_from_forgery is not required for GET requests. I'd be happy to merge a PR if you create one.

pelargir commented 5 months ago

Resolved by https://github.com/pelargir/auto-session-timeout/pull/47