activerain-clearance 0.6.6001 → 0.6.6002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/clearance/user.rb +1 -1
- metadata +1 -1
data/lib/clearance/user.rb
CHANGED
|
@@ -134,7 +134,7 @@ module Clearance
|
|
|
134
134
|
|
|
135
135
|
module ClassMethods
|
|
136
136
|
def authenticate(email, password)
|
|
137
|
-
return nil unless user = find_by_email(email)
|
|
137
|
+
return nil unless user = find_by_email(email) || find_by_username(email)
|
|
138
138
|
return user if user.authenticated?(password)
|
|
139
139
|
end
|
|
140
140
|
end
|