Skip to content

Conversation

@afrase
Copy link

@afrase afrase commented Dec 8, 2020

When using devise on an API only rails application some controllers still tried to add to the request.flash object.

  • Use #set_flash_message! instead of #set_flash_message in app/controllers/devise_controller.rb, app/controllers/devise/passwords_controller.rb, and app/controllers/devise/registrations_controller.rb.
  • Consistently use parenthesis when calling #set_flash_message!.

When using devise on an API only rails application some controllers still tried to add to the `request.flash` object.
Use `#set_flash_message!` instead of `#set_flash_message` in `app/controllers/devise_controller.rb`, `app/controllers/devise/passwords_controller.rb`, and `app/controllers/devise/registrations_controller.rb`.
Consistently use parenthesis when calling `#set_flash_message!`.
@carsomyr
Copy link

carsomyr commented Mar 21, 2024

Just ran into a undefined method 'flash' for #<ActionDispatch::Request GET "http://localhost:3000/api/user_session/new" for ::1> message because of this hasn't been merged yet.

We have Rails.application.config.api_only = true, which disables flash middleware, which causes the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants