Reputation: 920
I want to create a user without doing the verification, it’s set on false as soon as i create a user.
Is there a way that when i does the register the emails.verified will be set on TRUE and not false ?
Upvotes: 0
Views: 68
Reputation: 2518
This code on server side should do the trick:
Accounts.onCreateUser(function(options, user) {
user.emails[0].verified = true;
return user;
})
Upvotes: 1
Reputation: 1863
Place this code on the server, assuming you have only one email
AccountsTemplates.configure({postSignUpHook: postSignUp});
const postSignUp = function postSignUp(userId, info) {
Meteor.users.update(userId, {
$set: {
"emails.0.verified": true
}
});
}
Upvotes: 1