Skip to content

Commit

Permalink
Use authentication keys for resource lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide Abrigo committed Apr 3, 2024
1 parent 05ba483 commit bb80579
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -8,7 +8,7 @@ class Authenticate < Devise::Api::BaseService
option :resource_class, type: Types::Class

def call
resource = resource_class.find_for_authentication(email: params[:email])
resource = resource_class.find_for_authentication(params.slice(*resource_class.authentication_keys))
return Failure(error: :invalid_email, record: nil) if resource.blank?
return Failure(error: :invalid_authentication, record: resource) unless authenticate!(resource)

Expand Down

0 comments on commit bb80579

Please sign in to comment.