We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 665f130 commit a32fa2aCopy full SHA for a32fa2a
app/models/user.rb
@@ -123,7 +123,8 @@ def has_password?(submitted_password)
123
end
124
125
def self.authenticate(login, submitted_password)
126
- user = find_by_login(login)
+ user = find_by(login: login)
127
+ user = find_by(email: login) if user.nil?
128
return nil if user.nil?
129
return user if user.has_password?(submitted_password)
130
0 commit comments