Class: Devise::Strategies::Oauth2AuthorizationCodeGrantTypeStrategy

Inherits:
Oauth2GrantTypeStrategy show all
Defined in:
lib/devise/oauth2_providable/strategies/oauth2_authorization_code_grant_type_strategy.rb

Instance Method Summary collapse

Methods inherited from Oauth2GrantTypeStrategy

#authenticate!, #oauth_error!, #valid?

Instance Method Details

#authenticate_grant_type(client) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/devise/oauth2_providable/strategies/oauth2_authorization_code_grant_type_strategy.rb', line 10

def authenticate_grant_type(client)
  if code = client.authorization_codes.find_by_token(params[:code])
    success! code.user
  else
    oauth_error! :invalid_grant, 'invalid authorization code request'
  end
end

#grant_typeObject



6
7
8
# File 'lib/devise/oauth2_providable/strategies/oauth2_authorization_code_grant_type_strategy.rb', line 6

def grant_type
  'authorization_code'
end