forked from External/greenlight
handle invalid credentials
This commit is contained in:
parent
f8d2540665
commit
034c5ba617
@ -42,6 +42,10 @@ class SessionsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def auth_failure
|
def auth_failure
|
||||||
|
if params[:message] == 'invalid_credentials'
|
||||||
|
redirect_to '/', flash: {danger: 'Invalid login credentials.' }
|
||||||
|
else
|
||||||
redirect_to '/'
|
redirect_to '/'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -20,3 +20,8 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
|||||||
bind_dn: ENV['LDAP_BIND_DN'],
|
bind_dn: ENV['LDAP_BIND_DN'],
|
||||||
password: ENV['LDAP_PASSWORD']
|
password: ENV['LDAP_PASSWORD']
|
||||||
end
|
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