Sha256: 04c95be1f5bfa2f9c1a988442119b43b69996af71836b08b6bfb357190f32db7

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

module Omniauth
  module InstagramGraph
  	class LongLivedToken < OAuth2::AccessToken
  		TOKEN_REFRESH_PATH = '/refresh_access_token'


	    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
  	end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-instagram-graph-1.0.0 lib/omniauth/instagram-graph/long_lived_token.rb