Module: DeviseToken::Concerns::AuthenticateToken
Instance Method Summary
collapse
#auth_token_request, #auth_token_response, #authenticate_auth, #token
define_helpers
Instance Method Details
#find_resource(field, value) ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/devise_token/concerns/authenticate_token.rb', line 18
def find_resource(field, value)
q = "#{field.to_s} = ? AND provider='#{provider.to_s}'"
if ActiveRecord::Base.connection.adapter_name.downcase.starts_with? 'mysql'
q = "BINARY " + q
end
@resource = resource_class.where(q, value).first
end
|
#get_case_insensitive_field_from_resource_params(field) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'app/controllers/devise_token/concerns/authenticate_token.rb', line 8
def get_case_insensitive_field_from_resource_params(field)
q_value = resource_params[field.to_sym]
if resource_class.case_insensitive_keys.include?(field.to_sym)
q_value.downcase!
end
q_value
end
|
#provider ⇒ Object
38
39
40
|
# File 'app/controllers/devise_token/concerns/authenticate_token.rb', line 38
def provider
'email'
end
|