Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/spotify/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def authorize_url(override_params={})
#
def exchange_for_session(code)
validate_credentials!
Spotify::Accounts::Session.from_authorization_code(code)
Spotify::Accounts::Session.from_authorization_code(self, code)
end

def inspect # :nodoc:
Expand Down
8 changes: 4 additions & 4 deletions lib/spotify/accounts/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class << self
# Parse the response we collect from the authorization code.
#
# @example
# @session = Spotify::Accounts.from_authorization_code(@accounts, "authorization code here")
# @session = Spotify::Accounts.from_authorization_code(accounts, "authorization code here")
#
# @param [Spotify::Accounts] accounts A valid instance of Spotify::Accounts.
# @param [String] code The code provided in the Redirect URI from the Spotify Accounts API.
Expand All @@ -20,9 +20,9 @@ class << self
#
def from_authorization_code(accounts, code)
params = {
client_id: @accounts.instance_variable_get(:@client_id),
client_secret: @accounts.instance_variable_get(:@client_secret),
redirect_uri: @accounts.instance_variable_get(:@redirect_uri),
client_id: accounts.instance_variable_get(:@client_id),
client_secret: accounts.instance_variable_get(:@client_secret),
redirect_uri: accounts.instance_variable_get(:@redirect_uri),
grant_type: "authorization_code",
code: code
}
Expand Down