I’m trying to connect to a remote DDP server from a client. I can retrieve other collection data fine, except for the Meteor.users
collection.
I have some sample projects that illustrate my problem.
SERVER
- run on port 3000
meteor -p 3000
- The server should have some docs auto populated when you start it up.
CLIENT
- run on port 5005
meteor -p 5005
- I can successfully pull the Things collection data properly, and the button properly adds a new Thing to the remote database.
- Try logging in with username
test
and password1
. Open the logs and you’ll see that you logged in successfully, but there’s no user object.
Update:
After logging in this is what I get
-
Meteor.userId()
works as before and returns the logged in userId. -
Meteor.user()
returnsundefined
.
But,
const userId = Meteor.userId();
const user = Meteor.users.findOne(userId) // returns the proper user object.
Also, Meteor Toys shows 2 collections named users
, both empty.
Is this the proper behaviour?