Class: Devise::Strategies::ApiAuthenticatable

Inherits:
Authenticatable
  • Object
show all
Defined in:
decidim-api/lib/devise/strategies/api_authenticatable.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



8
9
10
11
12
13
14
15
16
# File 'decidim-api/lib/devise/strategies/api_authenticatable.rb', line 8

def authenticate!
  key = authentication_hash[:key]
  secret = authentication_hash[:secret]

  resource = mapping.to.find_for_api_authentication(api_key: key)
  validation_status = validate(resource) { resource.valid_api_secret?(secret) }

  success!(resource) if validation_status
end