I am trying to create a microservice that simply publishes notifications for the current user. I have been able to deploy, connect, and subscribe to the microservice. The problem is that no data is returned because
this.userId is undefined in the publication; the user is only authenticated in the app (on the default DDP connection) and not the connection for the microservice.
How would I go about doing this? Is there a way to “login” to a DDP connection, similar to
Meteor.loginWithPassword? Is there a way to make the subscription aware of the current user?
I have found some packages that attempt to tackle this issue, but they haven’t been maintained in awhile and I’d like to avoid adding dependencies if I can. I was hoping to find an “official” solution.