Skip to content

Commit

Permalink
fix: removed invite token from query
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 15, 2024
1 parent 3534d70 commit 92ccf7c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class CoCreateUser {
async inviteUser(data) {
try {
const inviteId = this.crud.ObjectId().toString()
let socket = data.socket
delete data.socket
let uid = data.uid
delete data.uid

Expand Down Expand Up @@ -228,7 +226,7 @@ class CoCreateUser {
this.wsManager.emit('postmark', email);

let response = {
socket,
socket: data.socket,
host: data.host,
method: 'inviteUser',
success: true,
Expand All @@ -255,23 +253,24 @@ class CoCreateUser {
return
}

let socket = data.socket
delete data.socket
let uid = data.uid
delete data.uid

data.method = 'object.update'
data.array = "users"
data.object = { '$pull.invitations': data.token, '$pull.members': data.email }
data.$filter = {
query: { invitations: { $in: [data.token] }, members: { $in: [data.email] } },
limit: 1
query: {
// invites: { $in: [data.token] },
members: { $in: [data.email] },
limit: 1
}
}

data = await this.crud.send(data)

let response = {
socket,
socket: data.socket,
host: data.host,
method: 'acceptInvite',
success: false,
Expand Down

0 comments on commit 92ccf7c

Please sign in to comment.