Skip to content

Commit

Permalink
fix: Allow issuer to be a regex (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea authored Apr 11, 2023
1 parent c64c04e commit b498007
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export interface FastifyAuth0VerifyOptions {
/**
* The Auth0 issuer (iss), usually the API name.
* By default the domain will be also used as audience.
* Accepts a string value, or an array of strings for multiple issuers.
* Accepts a string value, or an array of strings or regexes for multiple
* issuers.
*/
readonly issuer?: string | string[]
readonly issuer?: string | RegExp | (RegExp | string)[]
/**
* The Auth0 client secret. It enables verification of HS256 encoded JWT tokens.
*/
Expand Down
7 changes: 6 additions & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ fastify.register(fastifyAuth0Verify, {
})
fastify.register(fastifyAuth0Verify, {
domain: '<auth0 auth domain>',
issuer: ['<auth0 issuer>'],
issuer: /<auth0 issuer>/,
audience: '<auth0 app audience>'
})
fastify.register(fastifyAuth0Verify, {
domain: '<auth0 auth domain>',
issuer: ['<auth0 issuer>', /<auth0 issuer>/],
audience: ['<auth0 app audience>', '<auth0 admin audience>']
})
fastify.register(fastifyAuth0Verify, {
Expand Down

0 comments on commit b498007

Please sign in to comment.