mockpass icon indicating copy to clipboard operation
mockpass copied to clipboard

TypeError: destructure profile of lookUpByAuthCode is undefined

Open ngjialong opened this issue 1 year ago • 2 comments

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

ngjialong avatar Sep 12 '24 04:09 ngjialong

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?

cflee avatar Sep 15 '24 05:09 cflee

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

ngjialong avatar Sep 16 '24 02:09 ngjialong