added custom error handling

This commit is contained in:
Miodec 2023-01-29 14:42:47 +01:00
parent 85835334d1
commit 2aa95b4526

View file

@ -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;
}