and whoops - the userId was indeed set and inside ātheMethodā was indeed the expected userId and it cleared the user restrictions in there, like Roles etcetera.
What gives? calling this.setUserId() throws an error, but it also does what the thrown error say it doesnāt. Is there a danger here?
What other way can I use to get a API user ālegalā within my system? Seems like all REST kits for Meteor was abandoned almost a decade agoā¦
Ok, I am curious now.
You have clients as valid users of a Meteor project. Each client has a username and a valid password.
However, from the client (be it browser, React-Native, or Cordova or some other native thing) you want to REST call into your Meteor and return some results but not via the Meteor client.
I am trying to understand where you are calling from. Or are you trying to impersonate users?!
I make REST calls from external servers. I am probably doing it wrong, but I found no existing rest packages (simple-rest, restivus) that works with current versions of Meteor.
I just have server (iron) routes like
I ālog themā in with a bearer token by simply finding a user through that token and get this.userId, but calling a Meteor.method from in there will not ātransportā the userId (unless I use the hack above)
Everyone says you can do this with webapp. The documentation is still not clear and lack of examples.
Iām using restivus package, itās quite good but not maintained. I want to switch to axios after meteor 3 migration. If someone knows resources for webapp, it will be super.
This forum has at least 20 different discussions about webapp, with all possible examples and some fixes, the difference between rawConnectHandlers and connectHandlers, authentication etc
Another full example here: Microservices with Meteor - DEV Community
Alternative solution: simple:rest. You can just find the repo, update it, understand it and start using it and ideally push the updates to the community.
@guncebektas you are the new maintainer of Restivus.