mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 10:23:04 -05:00
9cc5dc968c
.../js/... -> .../src/... GitOrigin-RevId: ab509c633529440f05247d19c320ebb77d506768
39 lines
871 B
JavaScript
39 lines
871 B
JavaScript
const ProjectDetailsHandler = require('../../app/src/Features/Project/ProjectDetailsHandler')
|
|
const Async = require('async')
|
|
|
|
const projectIds = [
|
|
// put ids here
|
|
]
|
|
|
|
Async.eachLimit(
|
|
projectIds,
|
|
5,
|
|
(projectId, cb) => {
|
|
ProjectDetailsHandler.setPublicAccessLevel(projectId, 'tokenBased', err => {
|
|
if (err) {
|
|
return cb(err)
|
|
}
|
|
console.log(
|
|
`>> Set public-access-level to tokenBased for project ${projectId}`
|
|
)
|
|
ProjectDetailsHandler.ensureTokensArePresent(projectId, (err, tokens) => {
|
|
if (err) {
|
|
return cb(err)
|
|
}
|
|
console.log(
|
|
`>> Re-generated tokens for project ${projectId}, ${JSON.stringify(
|
|
tokens
|
|
)}`
|
|
)
|
|
cb()
|
|
})
|
|
})
|
|
},
|
|
err => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
console.log('>> Done')
|
|
process.exit(0)
|
|
}
|
|
)
|