From 5fb1cbf2175d8a5cee00ea4e365e3c4e68797d31 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Fri, 5 Dec 2014 11:58:39 -0800 Subject: [PATCH] update usability --- controllers/user.js | 4 ++-- views/account/login.jade | 47 ++------------------------------------- views/account/signup.jade | 17 -------------- 3 files changed, 4 insertions(+), 64 deletions(-) diff --git a/controllers/user.js b/controllers/user.js index 44224a98b5b..356f804c2a7 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -88,7 +88,7 @@ exports.postSignup = function(req, res, next) { if (errors) { req.flash('errors', errors); - return res.redirect('/login'); + return res.redirect('/signup'); } var user = new User({ @@ -99,7 +99,7 @@ exports.postSignup = function(req, res, next) { User.findOne({ email: req.body.email }, function(err, existingUser) { if (existingUser) { req.flash('errors', { msg: 'Account with that email address already exists.' }); - return res.redirect('/login'); + return res.redirect('/signup'); } user.save(function(err) { if (err) return next(err); diff --git a/views/account/login.jade b/views/account/login.jade index 0a2c709c891..3a490fe4839 100644 --- a/views/account/login.jade +++ b/views/account/login.jade @@ -17,50 +17,7 @@ block content a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter') i.fa.fa-twitter | Sign in with Twitter - hr - h2 Or you can use an email address: - form.form-horizontal(id='signup-form', action='signup', method='POST') - input(type='hidden', name='_csrf', value=_csrf) - .form-group - .col-sm-6.col-sm-offset-3 - input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus=true) - .form-group - .col-sm-6.col-sm-offset-3 - input.form-control(type='password', name='password', id='password', placeholder='Password') - .form-group - .col-sm-6.col-sm-offset-3 - input.form-control(type='password', name='confirmPassword', id='confirmPassword', placeholder='Confirm Password') - .form-group - .col-sm-offset-3.col-sm-6 - button.btn.btn-success(type='submit') - span.ion-person-add - | Sign up - hr - h2 If you previously signed up with your email address, sign in here: - form(action='login', method='POST') - input(type='hidden', name='_csrf', value=_csrf) - .col-sm-6.col-sm-offset-3 - .form-group - input.form-control(type='email', name='email', id='email', placeholder='Email') - .form-group - input.form-control(type='password', name='password', id='password', placeholder='Password') - .form-group - button.btn.btn-primary(type='submit') - span.ion-android-hand - | Sign in - span    - a.btn.btn-info(href='/forgot') Forgot your password? - .col-sm-12 - h2 You can trust us with your  - a(href="http://www.freecodecamp.com/privacy") privacy - | . - br - br - br - br - br - br - br - br br + p + a(href="/signup") Or sign in using your email address here. diff --git a/views/account/signup.jade b/views/account/signup.jade index 0bc111bd9ea..8886c2e36d9 100644 --- a/views/account/signup.jade +++ b/views/account/signup.jade @@ -1,23 +1,6 @@ extends ../layout block content .jumbotron.text-center - h2 Use any of these accounts to Sign up or Sign in to Free Code Camp: - a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook') - i.fa.fa-facebook - | Sign in with Facebook - a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin') - i.fa.fa-linkedin - | Sign in with LinkedIn - a.btn.btn-lg.btn-block.btn-google-plus.btn-social(href='/auth/google') - i.fa.fa-google-plus - | Sign in with Google - a.btn.btn-lg.btn-block.btn-github.btn-social(href='/auth/github') - i.fa.fa-github - | Sign in with GitHub - a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter') - i.fa.fa-twitter - | Sign in with Twitter - hr h2 Sign up with an email address here: form.form-horizontal(id='signup-form', method='POST') input(type='hidden', name='_csrf', value=_csrf)