Access Meteor.userId from outside a method/publish

前端 未结 2 377
悲&欢浪女
悲&欢浪女 2020-12-11 12:39

I\'m currently writing a server-centric package for Meteor, and the relevant code looks something like this:

__meteor_bootstrap__.app.stack.unshift({
    rou         


        
2条回答
  •  半阙折子戏
    2020-12-11 13:26

    My solution was inspired by the server part of @Akshat's method. Since I'm making a RESTful API, I just pass the userId/loginToken in every time (either as a param, cookie or header).

    For anyone interested, I bundled it as a package: https://github.com/gkoberger/meteor-reststop

提交回复
热议问题