Skip to content

Commit

Permalink
improve privyAuth middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
tinypell3ts committed Aug 12, 2024
1 parent 9ecbd15 commit b590ea8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/middlewares/privyAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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();
Expand Down

0 comments on commit b590ea8

Please sign in to comment.