From afd03a30506ff63eeef40187fac753ec8b219547 Mon Sep 17 00:00:00 2001 From: farhanW3 <132962163+farhanW3@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:18:56 +0530 Subject: [PATCH] fixed auth check on urls with startsWith (#338) --- src/server/middleware/auth.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/middleware/auth.ts b/src/server/middleware/auth.ts index fe15345cb..a9947c728 100644 --- a/src/server/middleware/auth.ts +++ b/src/server/middleware/auth.ts @@ -167,12 +167,12 @@ export const withAuth = async (server: FastifyInstance) => { req.url === "/health" || req.url === "/static" || req.url === "/json" || - req.url === "/auth/payload" || - req.url === "/auth/login" || - req.url === "/auth/user" || - req.url === "/auth/switch-account" || - req.url === "/auth/logout" || - req.url === "/transaction/status" + req.url.startsWith("/auth/payload") || + req.url.startsWith("/auth/login") || + req.url.startsWith("/auth/user") || + req.url.startsWith("/auth/switch-account") || + req.url.startsWith("/auth/logout") || + req.url.startsWith("/transaction/status") ) { // We skip auth check for static endpoints and auth routes return;