forked from External/greenlight
handle invalid credentials
This commit is contained in:
parent
f8d2540665
commit
034c5ba617
@ -42,6 +42,10 @@ class SessionsController < ApplicationController
|
||||
end
|
||||
|
||||
def auth_failure
|
||||
redirect_to '/'
|
||||
if params[:message] == 'invalid_credentials'
|
||||
redirect_to '/', flash: {danger: 'Invalid login credentials.' }
|
||||
else
|
||||
redirect_to '/'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -20,3 +20,8 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
||||
bind_dn: ENV['LDAP_BIND_DN'],
|
||||
password: ENV['LDAP_PASSWORD']
|
||||
end
|
||||
|
||||
# Redirect back to login in development mode.
|
||||
OmniAuth.config.on_failure = Proc.new { |env|
|
||||
OmniAuth::FailureEndpoint.new(env).redirect_to_failure
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user