You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Devise use find_for_database_authentication for finding the user which make it easy to support additional attributes like if we want to have single login field when I am using username and emails.
Would be great if token auth used find_for_database_authentication rather than doing it's own find.
@lynndylanhurley Let me know if you are open to it I will send in a pull request
in the meantime, if anyone else is looking to do the same, here is a quick hack overriding wherein User model.
def self.where(*args)
# override for devise-token auth
if args.length == 2 && args[0] == "login = ? AND provider='email'"
where(['lower(username) = :value OR lower(email) = :value', { value: args[1] }])
else
super
end
end
The text was updated successfully, but these errors were encountered:
Devise use
find_for_database_authentication
for finding the user which make it easy to support additional attributes like if we want to have single login field when I am using username and emails.Would be great if token auth used find_for_database_authentication rather than doing it's own find.
@lynndylanhurley Let me know if you are open to it I will send in a pull request
in the meantime, if anyone else is looking to do the same, here is a quick hack overriding wherein User model.
The text was updated successfully, but these errors were encountered: