We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8843c50 commit 2d00846Copy full SHA for 2d00846
backend/src/middlewares/auth.ts
@@ -191,6 +191,17 @@ async function authenticateWithBearerToken(
191
email: decodedToken.email ?? "",
192
};
193
} catch (error) {
194
+ if (
195
+ error instanceof Error &&
196
+ error.message.includes("An internal error has occurred")
197
+ ) {
198
+ throw new MonkeyError(
199
+ 503,
200
+ "Firebase returned an internal error when trying to verify the token.",
201
+ "authenticateWithBearerToken"
202
+ );
203
+ }
204
+
205
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
206
const errorCode = error?.errorInfo?.code as string | undefined;
207
0 commit comments