Open reidpd opened 7 years ago
Some work in progress? I'm getting the same error
You can't run authorizationCodeGrant
in the browser since this is part of the "server code" (https://github.com/thelinmichael/spotify-web-api-node/blob/master/src/server.js) and you can find where this magi happens here
https://github.com/thelinmichael/spotify-web-api-node/blob/master/package.json#L50
hi, @reidpd Did you solve the problem?
Hi, I'm getting the same issue. What's the resolution?
@Flynnp25 The issue means you are trying to run the code from the browser, and not the nodejs server. The call needs to be made from the server, since it includes the client secret that shouldn't be exposed. You can read more about the authorization flow in the README and Spotify's developer site](https://beta.developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow).
Since the token exchange involves sending your secret key, perform this on a secure location, like a backend service, and not from a client such as a browser or from a mobile app.
I get this error on the server side. I've a node backend and and angular front end
I’m opening the issue again
I am build a React app and am able to successfully get a token from the server side, but how do I access that token for my API call on the client side?
Expected: authorizationCodeGrant should be a function available for access using the library.
Actual: spotifyApiInstanceWithCredentials.authorizationCodeGrant is not a function.
When the instance is logged to the browser console, 'authorizationCodeGrant' does not appear as an available function for access.
This code was recently changed in an accepted PR.
Unable to get past this oauth business, help!