Created
March 9, 2012 14:38
-
-
Save cbetta/2006770 to your computer and use it in GitHub Desktop.
A better way handle Omniauth identity failed logins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OmniAuth.config.on_failure = -> env do | |
env[ActionDispatch::Flash::KEY] ||= ActionDispatch::Flash::FlashHash.new | |
env[ActionDispatch::Flash::KEY][:error] = "Either your email or password was not recognised. Please try again." | |
SessionsController.action(:new).call(env) #call whatever controller/action that displays your signup form | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would you edit this to work as flash.now? Any ideas?