I am working on an Meteor application. I have the meteor shell open. I need to do an insert for a quick test, but I need to pretend that I am authenticated as a particular user (I know the userId). Inside the meteor shell, is there a way for me to log in as a particular user given the userId?
Thank you!
You can't simulate logged in user in meteor shell.
I am not sure what exactly are you testing, but if it is some allow/deny rules on collection, try to create method that do your stuff, log in as wanted user and call method.
Also inside method you can run
this.setUserId(userId). This simply sets the value of userId for future method calls received on this connection.