diff options
| -rw-r--r-- | app.js | 1 | ||||
| -rw-r--r-- | assets/css/style.css | 30 | ||||
| -rw-r--r-- | routes/user.js | 5 | ||||
| -rw-r--r-- | views/reset_password.hbs | 51 | ||||
| -rw-r--r-- | views/signin.hbs | 6 |
5 files changed, 90 insertions, 3 deletions
@@ -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 @@ +<main id="solutions-main"> + <div class="row"> + <div class="slate signin-page col-sm-4 col-sm-offset-4 col-md-4 col-md-offset-4"> + <div class="container"> + {{# if success }} + <section class="alert alert-success"> + <!-- Change those to banners later --> + <h2>Signup Successful!</h2> + </section> + {{ else }} + {{# if errors }} + <section class="alert alert-danger"> + <ul> + {{# each errors }} + <li>{{ this.msg }}</li> + {{/each}} + </ul> + </section> + {{/if}} + {{/if}} + {{#if flashMsg}} + <section class="alert alert-danger"> + {{flashMsg}} + </section> + {{/if}} + + <h3 class="signin"><hr><i class="fa fa-unlock-alt" aria-hidden="true"></i> Reset Password<hr></h3> + <form action="/user/" method="post"> + <div class="form-group reset-group"> + <div class="input-group input-group-lg"> + <div class="input-group-addon addon-email-reset"> + <i class="fa fa-at" aria-hidden="true"></i> + </div> + <input type="text" class="form-control input-email-reset" placeholder="email" name="email-reset" required> + </div> + </div> + <input type="hidden" name="_csrf" value="{{ csrfToken }}"> + <button class="signin-btn signin-insite btn-lg btn btn-primary btn-block"><span>Submit</span></button> + + <div class="reset-bottom"> + <a href="/user/signin">Return to Sign in</a> + </div> + </form> + + + </div> + + </div> + </div> + +</main>
\ 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 @@ <a href="/auth/facebook" class="signin-fb signin-btn btn-lg btn btn-primary btn-block"><span> <span class="fa fa-facebook"> </span> Sign In with Facebook</span></a> + <div class="signin-bottom"> + <p>Don't have an account? <a href="/user/signup">Sign up</a> now!</p> + <a href="/user/resetPassword">Forgot your password?</a> </div> + + </div> + </div> </div> |
