From 12592d23a1e1b6a0e837ac228d05415562ab69e2 Mon Sep 17 00:00:00 2001 From: Chris Lambe Date: Tue, 14 Apr 2026 11:51:09 -0400 Subject: [PATCH] fix(WithAuth): `options.authRequired` can default to `undefined` --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 979b7a5..8001f90 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,7 +65,7 @@ export const WithAuth = < TBase extends Constructor> | Constructor>, >( Base: TBase, - options: WithAuthParams = { authRequired: true }, + options: WithAuthParams = {}, ) => { const authRequired = options.authRequired ?? true; const debug = options.debug ?? (() => {}); @@ -209,7 +209,7 @@ export const WithAuth = < async onRequest(req: Request) { try { const tokenSet = this.#getTokenSetFromRequest(req); - if (options.authRequired) { + if (authRequired) { await this.#validateTokenFromRequest(req); return this.#asyncTokenStorage.run(tokenSet, async () => { const authResponse = await this.onAuthenticatedRequest(req);