public
Last active

A better way handle Omniauth identity failed logins

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.