Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify state for Spotify OAuth #3

Open
foleyash opened this issue Sep 12, 2024 · 0 comments
Open

Verify state for Spotify OAuth #3

foleyash opened this issue Sep 12, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@foleyash
Copy link
Collaborator

foleyash commented Sep 12, 2024

I would like to add a check for the state variable inside /utils.ts/ for the module handleSpotifyAuth, which instantiates a state variable that should be verified (simple === will do) by the /api/spotify/getToken endpoint. The state should be included in the request URL (req.url) as the search parameter 'state'. This state variable ensures that the request to /api/spotify/getToken coming from the spotify API is a result of the call we make in handleSpotifyAuth, and not some outside entity. I would look into NextJS Cookies to store a cookie for the state variable between Server Components (this is what all /api/*/route.ts files are).

@foleyash foleyash added the good first issue Good for newcomers label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant