Update email info copy

This commit is contained in:
Berkeley Martinez
2016-06-02 13:01:32 -07:00
parent ff4dfb09da
commit 564f4c1180
4 changed files with 53 additions and 70 deletions

View File

@@ -1,5 +1,3 @@
import dedent from 'dedent';
export function ifNoUserRedirectTo(url, message, type = 'errors') {
return function(req, res, next) {
const { path } = req;
@@ -38,15 +36,10 @@ export function flashIfNotVerified(req, res, next) {
}
const email = req.user.email;
const emailVerified = req.user.emailVerified;
if (!email) {
req.flash('info', { msg:
dedent `Please update your email address when you get a moment in
your <a href="\settings"> Settings Page.</a>`
});
} else if (!emailVerified) {
req.flash('info', { msg:
dedent `We have your email address with us, but its not yet verified.
Please follow the link we sent you, when you get a moment.`
if (!email || !emailVerified) {
req.flash('info', {
msg: 'Please verify your email address ' +
'<a href="/update-email">here.</a>'
});
}
return next();