Skip to content

Verify state for Spotify OAuth #3

@foleyash

Description

@foleyash

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions