wavesync
wavesync copied to clipboard
auth_id undefined
I have configured the .env file in the root dir of wavesync/ like:
CLIENT_ID=xxxxxxx
CLIENT_SECRET=xxxxxx
REDIRECT_URI=http://localhost:8081/callback
PROJECT_ROOT=http://localhost:8081
NODE_ENV=development
and setup the http://localhost:8081/callback on the spotify developer app settings like here:
I run npm run serve and when I do the login I get a redirect to the url http://localhost:8081/login?auth_id=undefined
with a blank page.
I have printed the process.env here to be sure it was ok:
console.log("----",process.env,"----");
router.get('/', (req, res, next) => {
const auth_id = req.query.auth_id
const query = querystring.stringify({
response_type: 'code',
client_id: process.env.CLIENT_ID,
scope: 'user-read-playback-state',
redirect_uri: process.env.REDIRECT_URI,
state: auth_id
})
I can see CLIENT_ID and REDIRECT_URI values.