overleaf/services/web/scripts/check_saml_emails.mjs
Andrew Rumble df3be1bd5e Merge pull request #21288 from overleaf/ar-convert-modules-saas-authentication-to-es-modules
[web] Convert modules/saas-authentication to ES modules

GitOrigin-RevId: 5589bb2a7ad86da689994b6336cdac228de66c17
2024-10-31 09:05:08 +00:00

19 lines
588 B
JavaScript

import SAMLEmailBatchCheck from '../modules/saas-authentication/app/src/SAML/SAMLEmailBatchCheck.mjs'
import { ensureRunningOnMongoSecondaryWithTimeout } from './helpers/env_variable_helper.mjs'
ensureRunningOnMongoSecondaryWithTimeout(300000)
const startInstitutionId = parseInt(process.argv[2])
const emitDetailedData = process.argv.includes('--detailed-data')
try {
const result = await SAMLEmailBatchCheck.promises.checkEmails(
startInstitutionId,
emitDetailedData
)
console.table(result)
process.exit()
} catch (error) {
console.error(error)
process.exit(1)
}