-
Notifications
You must be signed in to change notification settings - Fork 206
Open
Labels
Description
We have been experiencing an issue where the wrong locale is being used for error messages returned from the Devise FailureApp, I believe it's due to the way that warden throws and catches.
The recommended way of setting the locale for a rails controller action is to use an around_action callback, e.g.
prepend_around_action :with_locale
def with_locale(action)
I18n.with_locale(current_locale) { action }
end
When warden fails to authenticate it throws and calls a rack endpoint, the failure app... This means that the around_action is exited so the locale is no longer applied.
I don't see any way to tell warden to preserve the locale that was applied when the throw was called. Should warden do this internally?
Darhazer and BrianSigafoos