Skip to content

Commit

Permalink
Local account email is now downcased to match the downcased value sto…
Browse files Browse the repository at this point in the history
…red in db (#1319)

Co-authored-by: Jesus Federico <jesus@123it.ca>
  • Loading branch information
farhatahmad and jfederico committed Apr 16, 2020
1 parent f4990b4 commit 5aa1868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def new
def create
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

# 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
return redirect_to(signin_path, alert: I18n.t("invalid_credentials")) unless user
Expand Down

0 comments on commit 5aa1868

Please sign in to comment.