overleaf/services/web/scripts/backfill_users_sso_attribute.js
Alexandre Bourdin 4997b7f1ee Merge pull request #20062 from overleaf/ab-saas-authentication-module-renaming
[web] Rename overleaf-integration module to saas-authentication

GitOrigin-RevId: 7d69e06a19da9855fa9a0962114ad97b45ad8875
2024-08-23 08:04:43 +00:00

31 lines
854 B
JavaScript

const SAMLUserIdAttributeBatchHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdAttributeBatchHandler')
const startInstitutionId = parseInt(process.argv[2])
const endInstitutionId = parseInt(process.argv[3])
process.env.LOG_LEVEL = 'info'
process.env.MONGO_CONNECTION_STRING =
process.env.READ_ONLY_MONGO_CONNECTION_STRING
console.log('Checking users at institutions')
console.log(
'Start institution ID:',
startInstitutionId ||
'none provided, will start at beginning of ordered list.'
)
console.log(
'End institution ID:',
endInstitutionId || 'none provided, will go to end of ordered list.'
)
SAMLUserIdAttributeBatchHandler.check(startInstitutionId, endInstitutionId)
.then(result => {
console.log(result)
process.exit(0)
})
.catch(error => {
console.error(error)
process.exit(1)
})