diff --git a/backend/src/middlewares/auth.ts b/backend/src/middlewares/auth.ts index 290a2421c..c862344af 100644 --- a/backend/src/middlewares/auth.ts +++ b/backend/src/middlewares/auth.ts @@ -184,6 +184,12 @@ async function authenticateWithBearerToken( "Token revoked. Please login again.", "authenticateWithBearerToken" ); + } else if (errorCode?.includes("auth/user-not-found")) { + throw new MonkeyError( + 401, + "User not found.", + "authenticateWithBearerToken" + ); } else { throw error; }