diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index 9d44eafd..de1aae47 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -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, + } + }) } } )