forked from External/greenlight
		
	@@ -146,12 +146,12 @@ class SessionsController < ApplicationController
 | 
				
			|||||||
    ldap_config[:uid] = ENV['LDAP_UID']
 | 
					    ldap_config[:uid] = ENV['LDAP_UID']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if params[:session][:username].blank? || session_params[:password].blank?
 | 
					    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
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    result = send_ldap_request(params[:session], ldap_config)
 | 
					    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'])
 | 
					    @auth = parse_auth(result.first, ENV['LDAP_ROLE_FIELD'], ENV['LDAP_ATTRIBUTE_MAPPING'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -314,6 +314,7 @@ en:
 | 
				
			|||||||
  home_room: Home Room
 | 
					  home_room: Home Room
 | 
				
			||||||
  info_update_success: Information successfully updated.
 | 
					  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: 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.
 | 
					  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:"
 | 
					  invite_message: "To invite someone to the meeting, send them this link:"
 | 
				
			||||||
  javascript:
 | 
					  javascript:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -658,7 +658,7 @@ describe SessionsController, type: :controller do
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      expect(response).to redirect_to(ldap_signin_path)
 | 
					      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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it "redirects to signin if no password provided" do
 | 
					    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(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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it "redirects to signin if no username provided" do
 | 
					    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(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
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user