mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Generate all missing tokens
This commit is contained in:
@@ -82,9 +82,11 @@ module.exports = ProjectDetailsHandler =
|
||||
if project.tokens? and project.tokens.readOnly? and project.tokens.readAndWrite?
|
||||
return callback(null, project.tokens)
|
||||
else
|
||||
tokens =
|
||||
readOnly: ProjectTokenGenerator.readOnlyToken()
|
||||
readAndWrite: ProjectTokenGenerator.readAndWriteToken()
|
||||
tokens = project.tokens || {}
|
||||
if !tokens.readOnly?
|
||||
tokens.readOnly = ProjectTokenGenerator.readOnlyToken()
|
||||
if !tokens.readAndWrite?
|
||||
tokens.readAndWrite = ProjectTokenGenerator.readAndWriteToken()
|
||||
Project.update {_id: project_id}, {$set: {tokens: tokens}}, (err) ->
|
||||
return callback(err) if err?
|
||||
callback(null, tokens)
|
||||
|
||||
Reference in New Issue
Block a user