Replies: 3 comments 1 reply
-
Quick remarks: You should absolutely NOT expose the refresh token to the client!!!! https://github.com/Harsh-npx/Spotify-react/blob/main/pages/api/auth/[...nextauth].js#L61 Your client secret should NOT HAVE the Regarding your issue, it sounds like you forgot to set the environment variables. |
Beta Was this translation helpful? Give feedback.
-
Check your client id and client secret in Spotify.for Developers and in your .env.local. I'm pretty sure there will be some issue in .env.local file . Also, set your redirect URL to "http://localhost:3000/api/auth/callback/spotify" in Edit Settings in My Dashboard. |
Beta Was this translation helpful? Give feedback.
-
Create .env.local file in your root directory and add code as below: `SPOTIFY_CLIENT_ID=YourSPOTIFYClientID JWT_SECRET=a2H1u5gJEzW7PHRHmxgYaQvxXlNnS1UV Since, NextAuth works with inbuild JSON Web Token(JWT) protection layer you may need to define in your pages/api/auth/[...nextauth].js file. Check official reference here `import NextAuth from 'next-auth'; export default NextAuth({ secret: process.env.JWT_SECRET, And, do as @nishant26n says Here Hope it helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
I am trying to Create a Spotify Clone everything went well but when I click on login I stay on the login page with no redirects I checked Chrome console no error there when I checked
Vs Code Terminal there was this error
I don't know why I am getting this but you can check my code Repo here
https://github.com/Harsh-npx/Spotify-react.git
Any Help would be appreciable
How to reproduce ☕️
I am Following this Video Tutorial -
https://www.youtube.com/watch?v=3xrko3GpYoU&t=5685s
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions