How to create a user with a verified email address in Meteor?

In my server device, I populate the database with some test users using the Accounts.createUser function. Now, I'm trying to figure out how to set the email checkbox of the created user as verified.

I tried setting the verified flag directly, but it does not work:

 Meteor.users.findOne(userId).emails[0].verified = true 
+4
source share
1 answer

If you want to update your user and set the check flag to true. Try it.

 Meteor.users.update(userId, {$set: {"emails.0.verified" :true}}); 

This will update the first email in the emails: [] array emails: [] .

+7
source

Source: https://habr.com/ru/post/1485102/


All Articles