Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Conversation

@sddion
Copy link

@sddion sddion commented Mar 30, 2024

I encountered an error where the identity parameter was required but not specified in the options during token generation. This resulted in a failure to create a new AccessToken instance.

Changes Made

  • Added the identity parameter to the options in the token generation process.
  • Ensured that the identity parameter is properly passed to the AccessToken constructor.

Error Details

Error: identity is required to be specified in options
    at new AccessToken (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/twilio/lib/jwt/AccessToken.js:28:19)
    at tokenGenerator (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/src/handler.js:13:23)
    at /home/dion/Desktop/voice-javascript-sdk-quickstart-node/src/router.js:7:12
    at Layer.handle [as handle_request] (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/route.js:149:13)
    at Route.dispatch (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/route.js:119:3)
    at Layer.handle [as handle_request] (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/layer.js:95:5)
    at /home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/index.js:284:15
    at Function.process_params (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/index.js:346:12)
    at next (/home/dion/Desktop/voice-javascript-sdk-quickstart-node/node_modules/express/lib/router/index.js:280:10)

Testing

  • Tested the fix locally to ensure that the error no longer occurs.
  • Added unit tests to cover the fix and prevent regressions.

Resolves issue where identity parameter was missing, causing AccessToken creation to fail.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant