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

TypeError: destructure profile of lookUpByAuthCode is undefined #685

Open
ngjialong opened this issue Sep 12, 2024 · 2 comments
Open

TypeError: destructure profile of lookUpByAuthCode is undefined #685

ngjialong opened this issue Sep 12, 2024 · 2 comments

Comments

@ngjialong
Copy link

Describe the bug
TypeError: Cannot destructure property 'profile' of 'lookUpByAuthCode(...)' as it is undefined.
at C:<truncated>\node_modules@opengovsg\mockpass\lib\express\oidc\v2-ndi.js:437:17
Node.js v22.8.0
[nodemon] app crashed - waiting for file changes before starting...

To Reproduce
Steps to reproduce the behavior:

  1. npm install module
  2. npm start module
  3. Get code from authorization endpoint
  4. Send a request to token endpoint

Expected behavior
Response from token endpoint, if the profile is defined properly.

Screenshots
image

@cflee
Copy link
Contributor

cflee commented Sep 15, 2024

Are you running with MOCKPASS_STATELESS set to false or unset? If so, was the mockpass process restarted / a different process in between getting the auth code from authorization endpoint and sending it to token endpoint?

If not, could you provide the mockpass version and which profile is being used to trigger this crash?

@ngjialong
Copy link
Author

I am using default configuration, so I presume the below (some referenced from readme):
MOCKPASS_STATELESS: not set
Mockpass process restarted: nope. npm start -> get auth code from auth endpoint -> send client assert JWT and auth code request to token endpoint -> TypeError occurred.
Different process between auth code from auth endpoint and sending it to token endpoint: nope. Default configuration.

Mockpass version: @opengovsg/[email protected]
image
Profile: first profile in MockPass' static data

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

No branches or pull requests

2 participants