From b4980077f2ffacde7e0e4bb768fc5f3f5bb6e901 Mon Sep 17 00:00:00 2001 From: Gus Narea Date: Tue, 11 Apr 2023 19:55:36 +0900 Subject: [PATCH] fix: Allow `issuer` to be a regex (#279) See: https://github.com/nearform/fast-jwt/blob/5cf5dd30492e41489c35e68dda58937ce6d705b6/src/index.d.ts#L119 --- index.d.ts | 5 +++-- index.test-d.ts | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8b2a492..e1c213c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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. */ diff --git a/index.test-d.ts b/index.test-d.ts index e359cc2..f4b482c 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -13,7 +13,12 @@ fastify.register(fastifyAuth0Verify, { }) fastify.register(fastifyAuth0Verify, { domain: '', - issuer: [''], + issuer: //, + audience: '' +}) +fastify.register(fastifyAuth0Verify, { + domain: '', + issuer: ['', //], audience: ['', ''] }) fastify.register(fastifyAuth0Verify, {