From ba43bb22a514a5100ae65ebbdd2d9c5581b2c01d Mon Sep 17 00:00:00 2001 From: nanalelfe Date: Tue, 23 Aug 2016 05:54:27 -0400 Subject: Added a reset password page --- app.js | 1 - assets/css/style.css | 30 ++++++++++++++++++++++++++-- routes/user.js | 5 +++++ views/reset_password.hbs | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ views/signin.hbs | 6 ++++++ 5 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 views/reset_password.hbs diff --git a/app.js b/app.js index 0c9c5e1..1bf49f7 100644 --- a/app.js +++ b/app.js @@ -58,7 +58,6 @@ app.use(function(req, res, next) { res.locals.login = req.isAuthenticated(); // global variable res.locals.session = req.session; res.locals.user = req.user; - console.log(req.user); res.locals.messages = req.session.messages; next(); }); diff --git a/assets/css/style.css b/assets/css/style.css index 108fffe..32c9fa9 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -585,7 +585,7 @@ hr { border-bottom-right-radius: 8px !important; box-shadow: none !important; } -.input-username { +.input-username, .input-email-reset { font-size: 1em !important; border-top-right-radius: 8px !important; } @@ -619,4 +619,30 @@ hr { height: auto !important; width: 65% !important; margin-left: 17%; -} \ No newline at end of file +} + +.signin-bottom, .reset-bottom { + text-align: center; + color: white; + font-weight: 200; + margin-top: 2%; +} + +.signin-bottom a, .reset-bottom a { + color: white; + font-weight: bold; + +} + +.reset-bottom { + margin-top: 4%; +} + +.signin-bottom a:hover, .reset-bottom a:hover { + color: #E8E8E8; +} + +.addon-email-reset { + border-top-left-radius: 8px !important; + border-bottom-left-radius: 8px !important; +} diff --git a/routes/user.js b/routes/user.js index d2eea37..5c69e4a 100644 --- a/routes/user.js +++ b/routes/user.js @@ -130,6 +130,11 @@ router.get('/user_profile', loggedIn, isUser, function(req, res, next) { }); +router.get('/resetPassword', loggedOut, function(req, res, next) { + res.render('reset_password', {csrfToken: req.csrfToken(), success: req.session.success, errors: req.session.errors}); + req.session.errors = null; +}); + /** Render/GET signin page. */ router.get('/signup', loggedOut, function(req, res, next) { diff --git a/views/reset_password.hbs b/views/reset_password.hbs new file mode 100644 index 0000000..754c65d --- /dev/null +++ b/views/reset_password.hbs @@ -0,0 +1,51 @@ +
+
+ +
+ +
\ No newline at end of file diff --git a/views/signin.hbs b/views/signin.hbs index 5f0e4c7..579b804 100644 --- a/views/signin.hbs +++ b/views/signin.hbs @@ -49,7 +49,13 @@ Sign In with Facebook +
+

Don't have an account? Sign up now!

+ Forgot your password?
+ + + -- cgit v1.2.3