forked from External/greenlight
Local account email is now downcased to match the downcased value stored in db (#1319)
Co-authored-by: Jesus Federico <jesus@123it.ca>
This commit is contained in:
parent
f4990b4523
commit
5aa1868f63
|
@ -65,12 +65,12 @@ class SessionsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
logger.info "Support: #{session_params[:email]} is attempting to login."
|
logger.info "Support: #{session_params[:email]} is attempting to login."
|
||||||
|
|
||||||
user = User.include_deleted.find_by(email: session_params[:email])
|
user = User.include_deleted.find_by(email: session_params[:email].downcase)
|
||||||
|
|
||||||
is_super_admin = user&.has_role? :super_admin
|
is_super_admin = user&.has_role? :super_admin
|
||||||
|
|
||||||
# Scope user to domain if the user is not a super admin
|
# Scope user to domain if the user is not a super admin
|
||||||
user = User.include_deleted.find_by(email: session_params[:email], provider: @user_domain) unless is_super_admin
|
user = User.include_deleted.find_by(email: session_params[:email].downcase, provider: @user_domain) unless is_super_admin
|
||||||
|
|
||||||
# Check user with that email exists
|
# Check user with that email exists
|
||||||
return redirect_to(signin_path, alert: I18n.t("invalid_credentials")) unless user
|
return redirect_to(signin_path, alert: I18n.t("invalid_credentials")) unless user
|
||||||
|
|
Loading…
Reference in New Issue