How can I make custom account-verification work?

I’m having trouble making custom account verification work without accounts-ui.

I tried doing URL recognition with Iron Router, but to no avail.

How can I make custom account-verification work, without accounts-ui?

What do you exactly mean by custom? What are you trying to customize? What are you expecting and what is in fact happening?

Are you talking about handling the email verification callback yourself?

Yes, I’m sorry if I worded it improperly.

Hum, my question was also meant to be the answer hehe :smile:

So assuming you wanted to handle the verification callback once the user has clicked the verification link from their email, the link I provided to meteor API should help you do this. If you need to do something server side, you can always do a once your callback has been hit.

Does this answer your question?

What if I wanted the link to redirect to a route, and I wanted to preserve the token?

So for example, for a onResetPasswordLink, would require the user to type their new password in a form. It would route to a new route, and preserve the token for when the user submits the form. Maybe there’s a better way.

What are your thoughts, and have you done this before? In my current knowledge, onResetPasswordLink and all other meteor email links don’t have this capability unless you’re using accounts-ui, which I’d like to stay away from.


Yeah sorry, can’t help much there. All I’ve done was custom logic+routing on client side when validation link is clicked.

This is incorrect. accounts-ui is just the html/css, all the callbacks and such you’re talking about is in either accounts-base or accounts-password.

I don’t know why you’re thinking this way. Meteor accounts’ existing process works pretty well imo. When you want to reset, you’ll just send a resetPassword email with a token (you can customise the email template). Then once that token is clicked, meteor handles authentication and logs you in (sets up a secure connection) with DDP and pops up the reset form (this can be customised too or you can redirect the callback to something else) and submitting the password is just a direct because you’re already authenticated so no need to keep the token.

Actually, what are you exactly wanting to do? I’m pretty sure I’ve misunderstood you somewhere hehe… :slight_smile:

Thanks, I just want to render a template on the email click and allow the user to reset their password within the template that is rendered.

You’re right in that the link contains the token, and once the link is clicked meteor handles the authentication and logs you in… but Meteor is still waiting for the done() callback. As soon as the done() callback is called, meteor will log you out, to allow access to the previous user who may have been logged in.

“done: A function to call when the password reset UI flow is complete. The normal login process is suspended until this function is called, so that the password for user A can be reset even if user B was logged in.” - Meteor Docs