Class: Devise::Strategies::Oauth2RefreshTokenGrantTypeStrategy

Inherits:
Oauth2GrantTypeStrategy show all
Defined in:
lib/devise/oauth2_providable/strategies/oauth2_refresh_token_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
17
# File 'lib/devise/oauth2_providable/strategies/oauth2_refresh_token_grant_type_strategy.rb', line 10

def authenticate_grant_type(client)
  if refresh_token = client.refresh_tokens.find_by_token(params[:refresh_token])
    env[Devise::Oauth2Providable::REFRESH_TOKEN_ENV_REF] = refresh_token
    success! refresh_token.user
  else
    oauth_error! :invalid_grant, 'invalid refresh token'
  end
end

#grant_typeObject



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

def grant_type
  'refresh_token'
end