From 7870b82249e963fb69052673b1a216f005972d35 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Wed, 26 Feb 2020 10:25:12 +0800 Subject: [PATCH] fix: server throw TypeError when user not sign-in Signed-off-by: BoHong Li --- lib/user/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/user/index.js b/lib/user/index.js index 74649463..36c1cd62 100644 --- a/lib/user/index.js +++ b/lib/user/index.js @@ -11,7 +11,7 @@ const { generateAvatar } = require('../letter-avatars') exports.getMe = async (req, res) => { if (!req.isAuthenticated()) { - res.status(401).send({ + return res.status(401).send({ status: 'forbidden' }) }