From b590ea8e208704ff4d1e838decc3b89f22305dcc Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Aug 2024 11:54:22 +0100 Subject: [PATCH] improve privyAuth middleware --- backend/src/middlewares/privyAuth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/middlewares/privyAuth.ts b/backend/src/middlewares/privyAuth.ts index 576f8ff..01249c8 100644 --- a/backend/src/middlewares/privyAuth.ts +++ b/backend/src/middlewares/privyAuth.ts @@ -15,7 +15,7 @@ export const privyAuthMiddleware = async (c: Context, next: Next) => { ?.replace("Bearer ", ""); if (!authToken) { - return c.text("unauthorized", 401); + return c.text("unauthorized - no auth token", 401); } try { @@ -38,10 +38,10 @@ export const privyAuthMiddleware = async (c: Context, next: Next) => { c.set("user", user as User); } else { - return c.text("unauthorized", 401); + return c.text("unauthorized - invalid auth token", 401); } } catch (error) { - return c.text("unauthorized", 401); + return c.text("unauthorized - error", 401); } await next();