class OmniAuth::InstagramGraph::LongLivedToken

Constants

TOKEN_REFRESH_PATH

Public Instance Methods

refresh!(params = {}) click to toggle source
# File lib/omniauth/instagram-graph/long_lived_token.rb, line 8
def refresh!(params = {})
  options = {
    token_url: TOKEN_REFRESH_PATH,
  }
  refresh_client = OmniAuth::InstagramGraph::LongLivedClient.new(client.id, client.secret, options)

  params[:grant_type] = 'ig_refresh_token'
  params[:access_token] = token

  refresh_client.get_token(params)
end