The way I used to do it before I moved all projects to Passwordless:
Have a route for the password reset and open a component / view something like: { path: '/reset-password/:token', component: ResetPasswordPage }
ResetPasswordPage is your new password form.
Do all client-side validations for your password… too short, too long, at least 1 alpha etc etc
Example of on submit function for your password form. This was done in React:
const handlePasswordSubmit = () => {
const { token } = match?.params // token from your link. Your route was defined as .../:token
// at this stage password was already tested for compliancy and password and retype password are equal.
// instead of console log use your user on-screen notifications system
Accounts.resetPassword(token, pass, err => {
if (err) {
console.log('It looks that this link has already been used and is now expired.')
} else {
console.log('Your password has been changed. Please log in with the new password!')
}
})
history.push('/signin') // send the user to the login screen
}
As the docs states, the method onResetPasswordLink registers a function to call when a reset password link is clicked, and it should be called in top-level code.
So inside of your /client/main.js (or starting point of your client), you can call it.