Wrong flash message is rendered when signing out
Environment
- Ruby 3.0.3p157
- Rails 7.0.4
- Devise 4.8.1
Current behavior
When a signed-in user visits destroy_user_session_path the flash message is "You need to sign in before continuing." (en.devise.failure.unauthenticated)
For reference, the link is <%= link_to 'Sign out', destroy_user_session_path, data: { turbo_method: :delete } %>
Expected behavior
When a signed-in user visits destroy_user_session_path the flash message should be "Signed out successfully."(en.devise.sessions.signed_out)
I fixed this by adding a sessions controller:
class SessionsController < Devise::SessionsController
def destroy
super do
return redirect_to new_user_session_path, notice: I18n.t('devise.sessions.signed_out'), status: :see_other
end
end
end
The main branch should contain all that's necessary for fully working with Turbo now, which should fix this. A new version will be released soon, but feel free to test it out from the main branch in the meantime, and report back on any issues. Thanks.