mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Hide access tokens if user is not the project owner.
This prevents sneaky read-only users from sniffing out the read-write link via the browser console.
This commit is contained in:
@@ -22,6 +22,9 @@ module.exports = EditorHttpController =
|
||||
Metrics.inc "editor.join-project"
|
||||
EditorHttpController._buildJoinProjectView req, project_id, user_id, (error, project, privilegeLevel) ->
|
||||
return next(error) if error?
|
||||
# Hide access tokens if this is not the project owner
|
||||
if privilegeLevel != 'owner' && project.tokens?
|
||||
project.tokens = {readOnly: '', readAndWrite: ''}
|
||||
res.json {
|
||||
project: project
|
||||
privilegeLevel: privilegeLevel
|
||||
|
||||
Reference in New Issue
Block a user