From 3f9359cc60ea1ba56fa79ffa42c8d71ab9f26158 Mon Sep 17 00:00:00 2001 From: jolynloh Date: Mon, 11 Nov 2024 00:23:57 +0800 Subject: [PATCH] Add response check --- .../qn-history-service/src/middlewares/basicAccessControl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/qn-history-service/src/middlewares/basicAccessControl.ts b/backend/qn-history-service/src/middlewares/basicAccessControl.ts index 1053b25a53..04aaea9930 100644 --- a/backend/qn-history-service/src/middlewares/basicAccessControl.ts +++ b/backend/qn-history-service/src/middlewares/basicAccessControl.ts @@ -12,6 +12,6 @@ export const verifyToken = ( .then(() => next()) .catch((err) => { console.log(err.response); - return res.status(err.response.status).json(err.response.data); + return res.status(err.response?.status).json(err.response?.data); }); };