Skip to content

Conversation

@jals1212
Copy link

@jals1212 jals1212 commented Nov 6, 2025

FIX: Update handlePkceVerifier to prevent missing code_challenge, and prevent state mismatch.

Description:

If something goes wrong in authorize endpoint (some extra authorizationParams missing or incorrect) and you try again to authorize you end up with a missing code_challenge in the query, same for state (state mismatch).

Fix:
Read the code (from event query) inside the handlePkceVerifier and handleState functions, if the code is present then is not necessary to regenerate the code_challenge or the state.

@jals1212 jals1212 changed the title fix: update handlePkceVerifier to prevent missing code_challenge fix: missing code_challenge and state mismatch Nov 25, 2025
@atinux
Copy link
Owner

atinux commented Dec 2, 2025

Why not reading the query.code directly from the event in the handlePkceVerifier and handleState utils? @jals1212

@jals1212
Copy link
Author

jals1212 commented Dec 2, 2025

Why not reading the query.code directly from the event in the handlePkceVerifier and handleState utils? @jals1212

You're right that's less invasive and leaner, I'll make the change. Thanks.

@jals1212
Copy link
Author

jals1212 commented Dec 2, 2025

Ready @atinux

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