mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Emails are case insensitive
This commit is contained in:
parent
0c8025d513
commit
01a68f8cc7
18 changed files with 105 additions and 13 deletions
|
@ -251,7 +251,7 @@ class UsersController < ApplicationController
|
|||
lower_email = Email.downcase(params[:email]).strip
|
||||
|
||||
# Raise an error if the email is already in use
|
||||
if User.where("email = ?", lower_email).exists?
|
||||
if User.find_by_email(lower_email)
|
||||
raise Discourse::InvalidParameters.new(:email)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue