bih / spotify-token-swap-service

Swap tokens for using Spotify APIs and SDKs, made really simple 🔑 ⛓
MIT License
41 stars 26 forks source link

I can't seem to get refresh tokens (hosted on Heroku) #4

Closed NeuronButter closed 5 years ago

NeuronButter commented 5 years ago

Hi! I've tried passing in a refresh token, looking like this: DbLMSKlJyqaSSdWSyEQMenkxcPKDcjY5swShRVWA93R9oE8pVnGm3qiid6E7 +ksYYRyKXaG5JF5Ip+iTmIY5LQOjbf2D9nNEdv7+KLIvTiZe7SYXX3V0Uqpv ga3CtJP79i0OXU9YZoQcY+y9cmS21SiKzRWBfntiYamSL6fU4KzTa5aUMBNv pA== through both my app with the Fetch API in JavaScript and in Postman. The error keeps coming up with "error": "invalid refresh_token"

NeuronButter commented 5 years ago

Never mind, all good! Looks like JavaScript handles \n different to other platforms. All fixed up now!

alfredoxyanez commented 5 years ago

@NeuronButter How exactly did you fix this? Ive tried to pass the refresh_token with and without \n and it doesn't seem to work

NeuronButter commented 5 years ago

I'm heading out now, but I'll upload my source code to fix it!

alfredoxyanez commented 5 years ago

Thanks!

alfredoxyanez commented 5 years ago

For anyone facing this issue you have to URL encode your refresh_token. You can try this website to debug https://www.urlencoder.org