1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Be a good citizen and always set the controller action, even if Devise is never calling the failure app through warden.

This commit is contained in:
José Valim 2009-10-18 13:10:46 -02:00
parent 609a83a76c
commit 193250711d

View file

@ -32,6 +32,12 @@ Warden::Manager.serialize_from_session do |klass, id|
klass.find(id)
end
# Be a good citizen and always set the controller action, even if Devise is
# never calling the failure app through warden.
Warden::Manager.before_failure do |env, opts|
env['warden'].request.params['action'] = 'new'
end
# Adds Warden Manager to Rails middleware stack, configuring default devise
# strategy and also the controller who will manage not authenticated users.
Rails.configuration.middleware.use Warden::Manager do |manager|