You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an account is timed out, the flash that comes out of the warden callback is
#<ActionDispatch::Flash::FlashHash:0x007ff91c8840d8 @used=#<Set: {:alert, :timedout}>, @closed=false, @flashes={:alert=>"Your session expired, please sign in again to continue.", :timedout=>true}, @now=nil>
Is the :timedout key necessary?
Ryan Bate's railscast has a popular code snippet for iterating through the flash hash:
<% flash.each do |key, msg| %>
<%= content_tag :div, msg, :id => key %>
<% end %>
This, in combination with the timeoutable module, renders two messages upon timing out the session instead of just the one I18n message. This can be worked around with a simple unless key == :timedout clause but should Devise really be writing to the flash in this manner?
The text was updated successfully, but these errors were encountered:
We could get away with storing it in session and cleaning it up afterwards but we would be replicating Rails' flash logic and lose other aspects like laziness.
When an account is timed out, the flash that comes out of the warden callback is
Is the :timedout key necessary?
Ryan Bate's railscast has a popular code snippet for iterating through the flash hash:
This, in combination with the timeoutable module, renders two messages upon timing out the session instead of just the one I18n message. This can be worked around with a simple
unless key == :timedout
clause but should Devise really be writing to the flash in this manner?The text was updated successfully, but these errors were encountered: