server: fix auth 500 errors

This commit is contained in:
Max Leiter 2022-03-29 17:11:13 -07:00
parent 871b57ea3c
commit 6de415ed99
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A3512F2F2F17EBDA

View file

@ -80,7 +80,11 @@ auth.post(
res.status(201).json({ token: token, userId: created_user.id })
} catch (e) {
next(e)
res.status(401).json({
error: {
message: e.message,
}
})
}
}
)
@ -116,7 +120,11 @@ auth.post(
throw errorToThrow
}
} catch (e) {
next(e)
res.status(401).json({
error: {
message: error,
}
})
}
}
)