Skip to content
Snippets Groups Projects
Unverified Commit f37f4c1e authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Fix LDAP password string (#2747)

* Fix LDAP password string

* Rspec
parent 58728073
No related branches found
No related tags found
No related merge requests found
......@@ -146,12 +146,12 @@ class SessionsController < ApplicationController
ldap_config[:uid] = ENV['LDAP_UID']
if params[:session][:username].blank? || session_params[:password].blank?
return redirect_to(ldap_signin_path, alert: I18n.t("invalid_credentials"))
return redirect_to(ldap_signin_path, alert: I18n.t("invalid_credentials_external"))
end
result = send_ldap_request(params[:session], ldap_config)
return redirect_to(ldap_signin_path, alert: I18n.t("invalid_credentials")) unless result
return redirect_to(ldap_signin_path, alert: I18n.t("invalid_credentials_external")) unless result
@auth = parse_auth(result.first, ENV['LDAP_ROLE_FIELD'], ENV['LDAP_ATTRIBUTE_MAPPING'])
......
......@@ -314,6 +314,7 @@ en:
home_room: Home Room
info_update_success: Information successfully updated.
invalid_credentials: The email and password you entered did not match our records. Try again or click Forgot Password to reset your password.
invalid_credentials_external: The email and password you entered did not match our records. Please try again.
invalid_login_method: Login failed due to account mismatch. You need to log in with omniauth.
invite_message: "To invite someone to the meeting, send them this link:"
javascript:
......
......@@ -658,7 +658,7 @@ describe SessionsController, type: :controller do
}
expect(response).to redirect_to(ldap_signin_path)
expect(flash[:alert]).to eq(I18n.t("invalid_credentials"))
expect(flash[:alert]).to eq(I18n.t("invalid_credentials_external"))
end
it "redirects to signin if no password provided" do
......@@ -672,7 +672,7 @@ describe SessionsController, type: :controller do
}
expect(response).to redirect_to(ldap_signin_path)
expect(flash[:alert]).to eq(I18n.t("invalid_credentials"))
expect(flash[:alert]).to eq(I18n.t("invalid_credentials_external"))
end
it "redirects to signin if no username provided" do
......@@ -686,7 +686,7 @@ describe SessionsController, type: :controller do
}
expect(response).to redirect_to(ldap_signin_path)
expect(flash[:alert]).to eq(I18n.t("invalid_credentials"))
expect(flash[:alert]).to eq(I18n.t("invalid_credentials_external"))
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment