diff --git a/server/boot/authentication.js b/server/boot/authentication.js index cf108fa3ba..cd9db97b8d 100644 --- a/server/boot/authentication.js +++ b/server/boot/authentication.js @@ -38,14 +38,6 @@ module.exports = function enableAuthentication(app) { ifUserRedirect, (req, res) => res.redirect(301, '/auth/auth0')); - router.get( - '/update-email', - ifNoUserRedirectHome, - (req, res) => res.render('account/update-email', { - title: 'Update your email' - }) - ); - router.get('/signout', (req, res) => { req.logout(); req.session.destroy( (err) => { diff --git a/server/middlewares/email-not-verified-notice.js b/server/middlewares/email-not-verified-notice.js index d674c0acfd..bdc430c433 100644 --- a/server/middlewares/email-not-verified-notice.js +++ b/server/middlewares/email-not-verified-notice.js @@ -4,7 +4,7 @@ const ALLOWED_METHODS = ['GET']; const EXCLUDED_PATHS = [ '/api/flyers/findOne', '/signout', - '/update-email' + '/settings/update-email' ]; export default function emailNotVerifiedNotice() { @@ -23,7 +23,7 @@ export default function emailNotVerifiedNotice() { confirm. ` ); - res.redirect('/update-email'); + res.redirect('/settings/update-email'); return next; } } diff --git a/server/views/account/update-email.jade b/server/views/account/update-email.jade index 53071a0747..c1887bed74 100644 --- a/server/views/account/update-email.jade +++ b/server/views/account/update-email.jade @@ -8,7 +8,7 @@ block content span.ion-close-circled#flash-close #flash-content h2.text-center Update your email address here: - form.form-horizontal.update-email(method='POST', action='/api/users/#{user.id}/update-email', name="updateEmailForm") + form.form-horizontal.update-email(method='POST', action='/update-my-email', name="updateEmailForm") .row .col-sm-6.col-sm-offset-3 input(type='hidden', name='_csrf', value=_csrf)