Skip to content

Commit

Permalink
Update Connections.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Oct 15, 2024
1 parent 11f4527 commit 1d96d5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meteor/server/Connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Meteor.onConnection((conn: Meteor.Connection) => {
}

// HACK: force the userId of the connection before it can be used.
// This ensures we know the permissions of the connection before it can try to do anything
// This ensures we know the permissions of the connection before it can try to do anything+
// This could probably be safely done inside a meteor method, as we only need it when directly modifying a collection in the client,
// but that will cause all the publications to restart when changing the userId.
// Note: this has been tested in Meteor 3.0.2 and it remains working
const connSession = (Meteor as any).server.sessions.get(conn.id)
if (!connSession) {
Expand Down

0 comments on commit 1d96d5e

Please sign in to comment.