mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 17:13:44 +00:00
Generate all missing tokens
This commit is contained in:
parent
70b1e42e36
commit
fe708fcc04
1 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue