patch: do not block response if user password check failed

This commit is contained in:
timothycarambat 2024-03-06 17:14:17 -08:00
parent 60fc5f715a
commit 273d824df4

View File

@ -59,14 +59,17 @@ function adminEndpoints(app) {
}
const { user: newUser, error } = await User.create(newUserParams);
await EventLogs.logEvent(
"user_created",
{
userName: newUser.username,
createdBy: currUser.username,
},
currUser.id
);
if (!!newUser) {
await EventLogs.logEvent(
"user_created",
{
userName: newUser.username,
createdBy: currUser.username,
},
currUser.id
);
}
response.status(200).json({ user: newUser, error });
} catch (e) {
console.error(e);