in my app I do policy checks for subs using await Meteor.userAsync() quite often. Like so:
Meteor.publish("vmessage.count", async function publish() {
const user = await Meteor.userAsync();
...
}
Problem is that now I get a bunch of
Meteor.userId can only be invoked in method calls or publications.
I know in principle I could also fall back to using this.userId and fetch the user details from the db, but the old pattern with await Meteor.userAsync()
is working pretty fine in meteor 2.14
is spread all over my project (would take a significant amout of time for me to refactor this, since I determine a users tenancy from the user object, in order to filter out the docs related to that tenantId)
Is this an uncommon design pattern or am I missing something? Any help or comments highly appreciated
Demo app will start working again fine when removing collection-hooks (there’s something hooked into Meteor.publish, I suspect this causes the issue) or after downgrading to meteor 2.14.