JAMES
LOPER

How to set a custom reset password handler in Meteor

I figured out how to override the default reset password handler and send the password reset email via CustomerIO.

Accounts.sendResetPasswordEmail = function(userId) {
	var token = Random.secret();
	Meteor.users.update(userId, {$set: {
		'services.password.reset': {
			'token': token,
			'email': email,
			'when': new Date()
		}
	}});
	
	CustomerIO.event(userId, {
		'name': 'reset_password',
		'data': {'reset_link': Accounts.urls.resetPassword(token)},
	});
};