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

Fix: Add identity parameter to options in token generation #249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 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.

1 participant