mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-18 03:45:18 -05:00
788009330c
[CE/SP] Hotfix 4.2.7/5.0.7 GitOrigin-RevId: e36a5af392c2356d4068a98acc2d637d879392f8
37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
--- a/services/web/app/src/Features/Collaborators/CollaboratorsInviteHandler.js
|
|
+++ b/services/web/app/src/Features/Collaborators/CollaboratorsInviteHandler.js
|
|
@@ -7,13 +7,16 @@ const UserGetter = require('../User/UserGetter')
|
|
const ProjectGetter = require('../Project/ProjectGetter')
|
|
const Crypto = require('crypto')
|
|
const NotificationsBuilder = require('../Notifications/NotificationsBuilder')
|
|
+const _ = require('lodash')
|
|
|
|
const randomBytes = promisify(Crypto.randomBytes)
|
|
|
|
const CollaboratorsInviteHandler = {
|
|
async getAllInvites(projectId) {
|
|
logger.debug({ projectId }, 'fetching invites for project')
|
|
- const invites = await ProjectInvite.find({ projectId }).exec()
|
|
+ const invites = await ProjectInvite.find({ projectId })
|
|
+ .select('_id email sendingUserId projectId privileges createdAt expires')
|
|
+ .exec()
|
|
logger.debug(
|
|
{ projectId, count: invites.length },
|
|
'found invites for project'
|
|
@@ -101,7 +104,15 @@ const CollaboratorsInviteHandler = {
|
|
logger.err({ err, projectId, email }, 'error sending messages for invite')
|
|
})
|
|
|
|
- return invite
|
|
+ return _.pick(invite.toObject(), [
|
|
+ 'email',
|
|
+ 'sendingUserId',
|
|
+ 'projectId',
|
|
+ 'privileges',
|
|
+ '_id',
|
|
+ 'createdAt',
|
|
+ 'expires',
|
|
+ ])
|
|
},
|
|
|
|
async revokeInvite(projectId, inviteId) {
|