add reset password flow

This commit is contained in:
cleverbeagle 2017-05-28 12:11:07 -05:00
parent e56cd9cf80
commit 779e3ee978
3 changed files with 128 additions and 0 deletions

View file

@ -0,0 +1,28 @@
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
const name = 'Application Name';
const email = '<support@application.com>';
const from = `${name} ${email}`;
const emailTemplates = Accounts.emailTemplates;
emailTemplates.siteName = name;
emailTemplates.from = from;
emailTemplates.resetPassword = {
subject() {
return `[${name}] Reset Your Password`;
},
text(user, url) {
const userEmail = user.emails[0].address;
const urlWithoutHash = url.replace('#/', '');
if (Meteor.isDevelopment) console.info(`Reset Password Link: ${urlWithoutHash}`);
return `A password reset has been requested for the account related to this
address (${userEmail}). To reset the password, visit the following link:
\n\n${urlWithoutHash}\n\n If you did not request this reset, please ignore
this email. If you feel something is wrong, please contact our support team:
${email}.`;
},
};

View file

@ -1,2 +1,3 @@
import './accounts';
import './api';
import './fixtures';