server: fix auth 500 errors

This commit is contained in:
Max Leiter 2022-03-29 17:11:13 -07:00
parent 871b57ea3c
commit 6de415ed99
No known key found for this signature in database
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,
}
})
}
}
)