javascript - Resent email verification link not changing verified to true -
i'm setting custom authentication system in meteor app.
when user signs up, sent email verification link. if click on this, changes verification boolean true expected.
i have button in users account setting page allows them resend verification email if needed. clicking on works ok , receive email different link.
when new link clicked, redirects home page doesn't verify email address.
my guess users account isn't aware of new token.
//server code meteor.methods({ 'sendverificationemail' : function(userid, primaryemail){ var userid = meteor.user(); accounts.sendverificationemail(userid, primaryemail, function (error) { if (! error) { return alert('verfication email sent'); } else { return alert(error); }; }); } }); //client code accounts.onemailverificationlink(function (token, done) { accounts.verifyemail(token, function (error) { if (! error) { console.log('account verified'); alert('account verified'); } done(); // show if there error. }); }); // email verification route router.route('/verify-email/:token', { name: 'verifyemail' });
Comments
Post a Comment