overleaf-cep/services/web/scripts/check_saml_emails.mjs
Liangjun Song 4d0f14898d Merge pull request #27518 from overleaf/tm-revert-scriptrunner-ensured-secondary
Remove ScriptRunner usage in institution user checks and SSO ID migration scripts

GitOrigin-RevId: 69bf575f879516e8daeb068f6911856c9d6f226c
2025-07-31 08:05:37 +00:00

20 lines
646 B
JavaScript

import SAMLEmailBatchCheck from '../modules/saas-authentication/app/src/SAML/SAMLEmailBatchCheck.mjs'
import { ensureRunningOnMongoSecondaryWithTimeout } from './helpers/env_variable_helper.mjs'
// ScriptRunner can not be used when using this assertion
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)
}