Class: OAuth2::BungieAccessToken

Inherits:
AccessToken
  • Object
show all
Defined in:
lib/oauth2/bungie_access_token.rb

Instance Method Summary collapse

Instance Method Details

#refresh!(params = {}) ⇒ Object

Updated refreshing method for a special bungie page



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/oauth2/bungie_access_token.rb', line 4

def refresh!(params = {})
  raise('A refresh_token is not available') unless refresh_token

  params[:client_id]     = @client.id
  params[:client_secret] = @client.secret
  params[:grant_type]    = 'refresh_token'
  params[:refresh_token] = refresh_token
  params[:refreshToken]  = params[:refresh_token]

  new_token = @client.get_token_with_refresh(params)
  new_token.options = options
  new_token.refresh_token = refresh_token unless new_token.refresh_token
  new_token
end