diff --git a/backend/backend/api/user.js b/backend/backend/api/user.js index 7c1aa1aa04..016f931bc1 100755 --- a/backend/backend/api/user.js +++ b/backend/backend/api/user.js @@ -434,7 +434,7 @@ router.post('/sso/callback', async function(req, res) { code: 400, message: 'SSO not defined for the domain.', }); - x; + if (!sso['saml-enabled']) return sendErrorResponse(req, res, { code: 401, diff --git a/backend/backend/services/domainVerificationService.js b/backend/backend/services/domainVerificationService.js index 480958381f..75892efcf3 100644 --- a/backend/backend/services/domainVerificationService.js +++ b/backend/backend/services/domainVerificationService.js @@ -267,7 +267,7 @@ module.exports = { }, deleteBy: async function(query) { try { - let domainCount = await this.countBy(query); + const domainCount = await this.countBy(query); if (!domainCount || domainCount === 0) { const error = new Error('Domain not found or does not exist'); @@ -275,7 +275,7 @@ module.exports = { throw error; } - domain = await this.updateOneBy(query, { + const domain = await this.updateOneBy(query, { deleted: true, deletedAt: Date.now(), }); diff --git a/backend/backend/services/gitCredentialService.js b/backend/backend/services/gitCredentialService.js index 2e9ea5d0e3..ec2360573a 100644 --- a/backend/backend/services/gitCredentialService.js +++ b/backend/backend/services/gitCredentialService.js @@ -97,7 +97,10 @@ module.exports = { }, { new: true } ); - gitCredential = await this.findOneBy({ _id: gitCredential._id, deleted: gitCredential.deleted }); // This is needed for proper query. It considers deleted and non-deleted git credentials + gitCredential = await this.findOneBy({ + _id: gitCredential._id, + deleted: gitCredential.deleted, + }); // This is needed for proper query. It considers deleted and non-deleted git credentials if (!gitCredential) { const error = new Error( diff --git a/backend/backend/services/incidentPrioritiesService.js b/backend/backend/services/incidentPrioritiesService.js index 001ee18691..601e387f79 100644 --- a/backend/backend/services/incidentPrioritiesService.js +++ b/backend/backend/services/incidentPrioritiesService.js @@ -50,7 +50,7 @@ module.exports = { incidentPrioritiesQuery ); - const incidentPriorities = await incidentPriorities; + const incidentPriorities = await incidentPrioritiesQuery; return incidentPriorities; } catch (error) { diff --git a/backend/test/sso.test.js b/backend/test/sso.test.js index 4f3371d4b4..3f0ccf7d1c 100644 --- a/backend/test/sso.test.js +++ b/backend/test/sso.test.js @@ -286,6 +286,3 @@ describe('SSO API', function() { }); }); }); - -const selectSso = - '_id saml-enabled domain entityId remoteLoginUrl certificateFingerprint remoteLogoutUrl ipRanges createdAt deleted deletedAt deletedById samlSsoUrl'; diff --git a/status-page/index.js b/status-page/index.js index 8dc602b742..6b2ddb6e82 100755 --- a/status-page/index.js +++ b/status-page/index.js @@ -28,10 +28,13 @@ function getMongoClient() { const client = getMongoClient(); (async function() { try { + // eslint-disable-next-line no-console console.log('connecting to db'); await client.connect(); + // eslint-disable-next-line no-console console.log('connected to db'); } catch (error) { + // eslint-disable-next-line no-console console.log('connection error: ', error); } })();