devise
devise copied to clipboard
More consistent use of `#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_messageinapp/controllers/devise_controller.rb,app/controllers/devise/passwords_controller.rb, andapp/controllers/devise/registrations_controller.rb. - Consistently use parenthesis when calling
#set_flash_message!.
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.