From 28ef808178aaf402befad28e88b6a288af7aa5d4 Mon Sep 17 00:00:00 2001 From: Jemma Poffinbarger Date: Tue, 30 Jul 2024 16:40:31 -0500 Subject: [PATCH] fix: allow /v1/endpoint access without user settings for new user creation --- src/middleware/auth.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/middleware/auth.ts b/src/middleware/auth.ts index 39dd799..4597ef4 100644 --- a/src/middleware/auth.ts +++ b/src/middleware/auth.ts @@ -97,7 +97,9 @@ async function auth(request: express.Request, response: express.Response, next: const userSettings = await getUserSettings(request.pid); - if (!userSettings) { + if (!userSettings && request.path === '/v1/endpoint') { + return next(); + } else if (!userSettings) { return badAuth(response, 18, 'BAD_PARAM'); }