devise icon indicating copy to clipboard operation
devise copied to clipboard

More consistent use of `#set_flash_message!`

Open afrase opened this issue 5 years ago • 1 comments

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!.

afrase avatar Dec 08 '20 18:12 afrase

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.

carsomyr avatar Mar 21 '24 06:03 carsomyr