From 6ca8807a9b040568d0475b48f6d9ad0a86782676 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Mon, 28 Jan 2019 13:16:24 -0800 Subject: [PATCH] changing to user and error code for forbidden --- app/controllers/auth.controller.js | 2 +- app/middleware/check-auth.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/auth.controller.js b/app/controllers/auth.controller.js index a9afe7f..c1cf147 100644 --- a/app/controllers/auth.controller.js +++ b/app/controllers/auth.controller.js @@ -37,7 +37,7 @@ exports.login = (type, role) => (req, res, next) => { ); return res.status(200).json({ message: 'Auth successful', - donor: users[0], + user: users[0], token }); } diff --git a/app/middleware/check-auth.js b/app/middleware/check-auth.js index 95e0e96..947d9b1 100644 --- a/app/middleware/check-auth.js +++ b/app/middleware/check-auth.js @@ -14,7 +14,7 @@ module.exports = role => (req, res, next) => { next(); } catch (error) { error.message = 'Check Auth Error'; - error.status = 401; + error.status = 403; return next(error); } };