diff --git a/common/models/user.js b/common/models/user.js index c318a88b94..d1e24a9e96 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -156,7 +156,7 @@ module.exports = function(User) { req.flash('errors', { msg: 'Invalid username or password.' }); - return res.redirect('/'); + return res.redirect('/email-signin'); }); User.afterRemote('logout', function(ctx, result, next) { diff --git a/server/boot/user.js b/server/boot/user.js index a3333b37c6..fe95432946 100644 --- a/server/boot/user.js +++ b/server/boot/user.js @@ -201,9 +201,6 @@ module.exports = function(app) { req.assert('password', 'Password must be at least 4 characters long') .len(4); - req.assert('confirmPassword', 'Passwords do not match') - .equals(req.body.password); - var errors = req.validationErrors(); if (errors) { diff --git a/server/views/account/email-signin.jade b/server/views/account/email-signin.jade index b1c3fa4b46..e36d19b97b 100644 --- a/server/views/account/email-signin.jade +++ b/server/views/account/email-signin.jade @@ -1,27 +1,19 @@ extends ../layout block content - .jumbotron.text-center(ng-controller="emailSignInController") - h2 Sign in with an email address here: - form(method='POST', action='/api/users/login') - 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', ng-model='email', autofocus=true) - | {{ $scope.email }} - .form-group - input.form-control(type='password', name='password', id='password', placeholder='Password', ng-model='password') - .form-group - button.btn.btn-primary(type='submit') - span.ion-android-hand - | Login - span    - a.btn.btn-info(href='/forgot') Forgot your password? - br - br - br - br - br - br - br - br - br + .jumbotron.text-center + .row + .col-xs-12 + h2 Sign in with an email address here: + .col-sm-6.col-sm-offset-3 + form(method='POST', action='/api/users/login') + input(type='hidden', name='_csrf', value=_csrf) + .form-group + input.input-lg.form-control(type='email', name='email', id='email', placeholder='Email', autofocus=true) + .form-group + input.input-lg.form-control(type='password', name='password', id='password', placeholder='Password') + button.btn.btn-primary.btn-lg.btn-block(type='submit') + span.ion-android-hand + | Login + .button-spacer + .button-spacer + a.btn.btn-info.btn-lg.btn-block(href='/forgot') Forgot your password? diff --git a/server/views/account/email-signup.jade b/server/views/account/email-signup.jade index 965eca605e..15ab666565 100644 --- a/server/views/account/email-signup.jade +++ b/server/views/account/email-signup.jade @@ -1,51 +1,18 @@ extends ../layout block content + script. + var challengeName = 'Email Signup' .jumbotron.text-center h2 Sign up with an email address here: - form.form-horizontal(method='POST', action='/api/users', name="signupForm", novalidate="novalidate") - input(type='hidden', name='_csrf', value=_csrf) - .form-group - .col-sm-6.col-sm-offset-3 - input.form-control(type='email', ng-model='email', ng-keypress='', name='email', id='email', placeholder='email', autofocus, required, autocomplete="off", unique-email='') - .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="signupForm.email.$error.required && !signupForm.email.$pristine") - alert(type='danger') - span.ion-close-circled - | Your email address is required. - .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="signupForm.$error.email && !signupForm.email.$pristine") - alert(type='danger') - span.ion-close-circled - | Please enter a valid email format. - .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="signupForm.email.$error.unique && !signupForm.email.$pristine") - alert(type='danger') - span.ion-close-circled - | That email address is already in use. - .form-group - .col-sm-6.col-sm-offset-3 - input.form-control(type='password', ng-model='password', name='password', id='password', placeholder='password', required, ng-minlength=8) - .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="signupForm.password.$error.minlength && !signupForm.password.$pristine") - alert(type='danger') - span.ion-close-circled - | Your password must be at least 8 characters long. - .form-group - .col-sm-6.col-sm-offset-3 - input.form-control(type='password', ng-model='confirmPassword', name='confirmPassword', id='confirmPassword', placeholder='confirm password', required, ng-minlength=5) - .col-sm-6.col-sm-offset-3(ng-cloak, ng-show="(confirmPassword !== password) && !signupForm.confirmPassword.$pristine") - alert(type='danger') - span.ion-close-circled - | Passwords must match. - .form-group - .col-sm-6.col-sm-offset-3 - button.btn.btn-success(type='submit', ng-disabled='signupForm.$invalid') - span.ion-person-add - | Signup - br - br - br - br - br - br - br - br - br - script. - var challengeName = 'Email Signup' + form.form-horizontal(method='POST', action='/api/users', name="signupForm") + .row + .col-sm-6.col-sm-offset-3 + input(type='hidden', name='_csrf', value=_csrf) + .form-group + input.input-lg.form-control(type='email', name='email', id='email', placeholder='email', autofocus, required, autocomplete="off") + .form-group + input.input-lg.form-control(type='password', name='password', id='password', placeholder='password', required, pattern=".{8,50}", title="Must be at least 8 characters and no longer than 50 characters.") + .form-group + button.btn.btn-lg.btn-success.btn-block(type='submit') + span.ion-person-add + | Signup diff --git a/server/views/account/forgot.jade b/server/views/account/forgot.jade index 14527a4f27..c5da16558c 100644 --- a/server/views/account/forgot.jade +++ b/server/views/account/forgot.jade @@ -3,14 +3,13 @@ extends ../layout block content .col-sm-8.col-sm-offset-2.jumbotron form(method='POST', action="/forgot") - h1 Forgot Password + h2.text-center Forgot Password Reset input(type='hidden', name='_csrf', value=_csrf) .form-group - p Enter your email address below and we will send you password reset instructions. - label.control-label(for='email') Email - input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus=true) + p Enter your email address. We'll send you password reset instructions. + input.form-control.input-lg(type='email', name='email', id='email', placeholder='Email', autofocus=true required) .form-group - button.btn.btn-primary(type='submit') + button.btn.btn-primary.btn-lg.btn-block(type='submit') i.fa.fa-key | Reset Password diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index 1064224f04..fc523027da 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -19,6 +19,6 @@ block content | Sign in with LinkedIn br p - a(href="/email-signup") Or sign up using your email address here. + a(href="/email-signin") Or sign in to your existing account with your email address and password here. p - a(href="/email-signin") Sign in to your existing account with your email address here. + a(href="/email-signup") Or sign up using your email address here (you'll need to remember a password).