-
Notifications
You must be signed in to change notification settings - Fork 49
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
Bug: The idTokenData is not set #49
Comments
Hi, |
Hi @soofstad , thank you for your reply. I created a fork of the project https://github.com/albertwangnz/react-oauth2-pkce-issue49, and you can see my change in the example As you can see in the screenshot below, idTokenData is empty but idToken is not, and I can manually parse idToken to an object with the data. |
I just guess the issue might be missing of using src/AuthContext.tsx Line 195. |
I think he's right. The idToken data is decoded and assign on line 105 of the AuthContext when a login happens...... but there is another effect() that decodes the access token that starts on line 163..... What is the purpose of that effect() ? An additional decode for both tokens might need to be placed in there. They should both also obey the configuration "config.decodeToken" to decide on if token decoding happens at all. |
You are both absolutely right. As it is now, we decode the idToken on a received token response, but not when loading the page when the idToken is already fetched. Will get a fix for this ASAP. |
Really appreciate your so fast response :-) |
Issue resolved by 85744ec. Version 1.9.1 is now available with this included. |
Tested and it works. Thanks! |
The idTokenData is not set.
Steps To Reproduce
The current behavior
The expected behavior
{JSON.stringify(idTokenData, null, 2)} should show the payload of the id token.
The text was updated successfully, but these errors were encountered: