mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 17:13:44 +00:00
Add logging for token generation
This commit is contained in:
parent
fe708fcc04
commit
22c5f41fb6
1 changed files with 7 additions and 0 deletions
|
@ -80,8 +80,15 @@ module.exports = ProjectDetailsHandler =
|
|||
ProjectGetter.getProject project_id, {tokens: 1}, (err, project) ->
|
||||
return callback(err) if err?
|
||||
if project.tokens? and project.tokens.readOnly? and project.tokens.readAndWrite?
|
||||
logger.log {project_id}, "project already has tokens"
|
||||
return callback(null, project.tokens)
|
||||
else
|
||||
logger.log {
|
||||
project_id,
|
||||
has_tokens: project.tokens?,
|
||||
has_readOnly: project?.tokens?.readOnly?,
|
||||
has_readAndWrite: project?.tokens?.readAndWrite?
|
||||
}, "generating tokens for project"
|
||||
tokens = project.tokens || {}
|
||||
if !tokens.readOnly?
|
||||
tokens.readOnly = ProjectTokenGenerator.readOnlyToken()
|
||||
|
|
Loading…
Reference in a new issue