Skip to content

Instantly share code, notes, and snippets.

@birchestx
Created March 5, 2014 10:05
Show Gist options
  • Save birchestx/9364518 to your computer and use it in GitHub Desktop.
Save birchestx/9364518 to your computer and use it in GitHub Desktop.
In config/initializers/devise.rb configure your custom failure app:
config.warden do |manager|
manager.failure_app = CustomFailureApp
end
And in lib/custom_failure_app.rb:
class CustomFailureApp < Devise::FailureApp
def redirect
message = warden.message || warden_options[:message]
if message == :timeout
redirect_to attempted_path
else
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment