From c13c79de4889235c5a7b6802b9edcc8cf1fca708 Mon Sep 17 00:00:00 2001 From: mgtennant <100305096+mgtennant@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:53:02 -0700 Subject: [PATCH] remove debug logs, update user error check --- app/client/src/utilities/api.ts | 2 -- app/server/middleware/roleValidation.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/client/src/utilities/api.ts b/app/client/src/utilities/api.ts index 51374a73..fed10968 100644 --- a/app/client/src/utilities/api.ts +++ b/app/client/src/utilities/api.ts @@ -58,8 +58,6 @@ async function request( err.response.data.code && err.response.data.description ) { - console.log(err.response.data); - console.log(err.response.data.description); return Promise.reject( new ApiError(err.response.data.code, err.response.data.description) ); diff --git a/app/server/middleware/roleValidation.js b/app/server/middleware/roleValidation.js index 1b1314c3..c8c0b39f 100644 --- a/app/server/middleware/roleValidation.js +++ b/app/server/middleware/roleValidation.js @@ -20,7 +20,7 @@ module.exports = function (roles) { return async function (req, res, next) { try { const data = await fetchUser(req.currentUser.idir_username.toUpperCase()); - if (data !== undefined) { + if (data !== undefined && data !== null) { const logical = user.convertToLogicalModel(data); if (roles.some((role) => logical.roleId === role)) {