Skip to content

Conversation

@AtomikkuLabs
Copy link

@AtomikkuLabs AtomikkuLabs commented May 26, 2025

Fixes indefinite hang when an invalid client_id is put into SpotifyPKCE and get_access_token is called. A preflight has been made to test out the client_id beforehand. Not sure if this is the most valid approach but it seems to work and gives a clear error.

PKCE issue was noted by me here

@dieser-niko
Copy link
Member

Sorry for the late reply. But I have to say, I really like it!

Just one thing. We won't be able to verify the redirect_uri, are we?

@AtomikkuLabs
Copy link
Author

AtomikkuLabs commented Jun 13, 2025

Sorry for the late reply. But I have to say, I really like it!

Just one thing. We won't be able to verify the redirect_uri, are we?

Thanks for the reply @dieser-niko. An invalid redirect_uri will cause the preflight to fail as well but that does not matter as we only raise an invalid client_id error and prevent the webpage from opening (therefore freezing the program) when we get a 'invalid_client' error from the preflights response. If the redirect_uri is wrong it will produce a generic 'invalid_grant' response which will cause it to just continue and open the webpage as normal, producing "INVALID_CLIENT: Invalid redirect URI" and freezing the program. I do not see this as an issue as developers should be putting a correct redirect_uri in statically. Since programs like my own need to allow a user to input their own client_id (in which a user may input garbage), it needs to not freeze the program like it currently does without my preflight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants