update usability
parent
704b4e52a3
commit
5fb1cbf217
|
@ -88,7 +88,7 @@ exports.postSignup = function(req, res, next) {
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
req.flash('errors', errors);
|
req.flash('errors', errors);
|
||||||
return res.redirect('/login');
|
return res.redirect('/signup');
|
||||||
}
|
}
|
||||||
|
|
||||||
var user = new User({
|
var user = new User({
|
||||||
|
@ -99,7 +99,7 @@ exports.postSignup = function(req, res, next) {
|
||||||
User.findOne({ email: req.body.email }, function(err, existingUser) {
|
User.findOne({ email: req.body.email }, function(err, existingUser) {
|
||||||
if (existingUser) {
|
if (existingUser) {
|
||||||
req.flash('errors', { msg: 'Account with that email address already exists.' });
|
req.flash('errors', { msg: 'Account with that email address already exists.' });
|
||||||
return res.redirect('/login');
|
return res.redirect('/signup');
|
||||||
}
|
}
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) return next(err);
|
if (err) return next(err);
|
||||||
|
|
|
@ -17,50 +17,7 @@ block content
|
||||||
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
||||||
i.fa.fa-twitter
|
i.fa.fa-twitter
|
||||||
| Sign in with 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
|
br
|
||||||
|
p
|
||||||
|
a(href="/signup") Or sign in using your email address here.
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,6 @@
|
||||||
extends ../layout
|
extends ../layout
|
||||||
block content
|
block content
|
||||||
.jumbotron.text-center
|
.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:
|
h2 Sign up with an email address here:
|
||||||
form.form-horizontal(id='signup-form', method='POST')
|
form.form-horizontal(id='signup-form', method='POST')
|
||||||
input(type='hidden', name='_csrf', value=_csrf)
|
input(type='hidden', name='_csrf', value=_csrf)
|
||||||
|
|
Loading…
Reference in New Issue