mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-26 08:47:36 +08:00
Fix logic to not delete user if DB goes down (#3171)
This commit is contained in:
parent
ae300bfa94
commit
6a3f01f6a9
1 changed files with 11 additions and 7 deletions
|
|
@ -103,13 +103,17 @@ export async function getUser(
|
|||
try {
|
||||
userInfo = await UserDAL.getUser(uid, "get user");
|
||||
} catch (e) {
|
||||
await admin.auth().deleteUser(uid);
|
||||
throw new MonkeyError(
|
||||
404,
|
||||
"User not found. Please try to sign up again.",
|
||||
"get user",
|
||||
uid
|
||||
);
|
||||
if (e.status === 404) {
|
||||
await admin.auth().deleteUser(uid);
|
||||
throw new MonkeyError(
|
||||
404,
|
||||
"User not found. Please try to sign up again.",
|
||||
"get user",
|
||||
uid
|
||||
);
|
||||
}
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
const agentLog = buildAgentLog(req);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue