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

Envelop Auth0 plugin only accepts a single audience string when it should also accept an array of audiences #2199

Closed
1 of 4 tasks
KurtMar opened this issue Mar 28, 2024 · 1 comment

Comments

@KurtMar
Copy link
Contributor

KurtMar commented Mar 28, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a
    minimal reproduction available on
    Stackblitz.
    • Please install the latest @envelop/* packages that you are using.
    • Please make sure the reproduction is as small as possible.
  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

The Auth0 plugin only accepts a single audience when the underlying jsonwebtoken library also accepts (among others) an array of string and actually internally creates an array from a single audience if provided.

To Reproduce

No reproduction.

See jsonwebtoken project for how the property is handled to see that it can in fact receive an array: https://github.com/auth0/node-jsonwebtoken/blob/bc28861f1fa981ed9c009e29c044a19760a0b128/verify.js#L195

Compare to the envelop auth0 plugin:

Expected behavior

Allow passing an array of strings to the function. Preferably whatever the jsonwebtoken types indicate, which is currently:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/518b9ae4a518c621700a97be30ee128b66a5da78/types/jsonwebtoken/index.d.ts#L60

audience?: string | RegExp | Array<string | RegExp> | undefined;

Environment:

  • OS: MacOS
  • NodeJS: 20
  • @envelop/* versions:
    • @envelop/core: 5.0.0
    • @envelop/auth0: 6.0.0

Additional context

NA

@EmrysMyrddin
Copy link
Collaborator

Fixed by #2200

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