Skip to content

Commit

Permalink
RST-5564 Downcase email for user search (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaparka authored Jul 14, 2023
1 parent 50c4233 commit c1184dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def set_reset_password_token
end

def user
@user ||= User.find_by(email: params[:user][:email].strip)
email = params[:user][:email].strip.downcase
@user ||= User.find_by(email: email)
end

def reset_link
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ def filter_params
end

def flash_notices_for_update(update_successful)
# rubocop:disable Rails/I18nLocaleTexts
flash[:notice] = ''
flash[:notice] = I18n.t('users.notice.updated') if update_successful
flash[:notice] += " #{email_confiration_message}" if new_email?
flash[:notice] = user_transfer_notice if UserManagement.new(current_user, @user).transferred?
# rubocop:enable Rails/I18nLocaleTexts
end

def user_params
Expand Down

0 comments on commit c1184dd

Please sign in to comment.