diff --git a/config/passport.js b/config/passport.js index 55ab6ff72f..04b02132b1 100755 --- a/config/passport.js +++ b/config/passport.js @@ -160,7 +160,9 @@ passport.use(new GoogleStrategy({ // Simple route middleware to ensure user is authenticated. Otherwise send to login page. exports.ensureAuthenticated = function ensureAuthenticated(req, res, next) { - if (req.isAuthenticated()) { return next(); } + if (req.isAuthenticated()) { + return next(); + } res.redirect('/login'); }; diff --git a/controllers/user.js b/controllers/user.js index eeb765b01a..e3715ecae1 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -17,6 +17,10 @@ exports.account = function(req, res) { * GET /login */ exports.getLogin = function(req, res) { + if (req.user) { + return res.redirect('back'); + } + res.render('login', { title: 'Login', user: req.user, @@ -48,6 +52,10 @@ exports.postLogin = function(req, res, next) { * GET /signup */ exports.getSignup = function(req, res) { + if (req.user) { + return res.redirect('back'); + } + res.render('signup', { title: 'Create Account', user: req.user, diff --git a/public/css/app.less b/public/css/app.less index dc4aac38f5..8fe17f2578 100644 --- a/public/css/app.less +++ b/public/css/app.less @@ -6,3 +6,4 @@ body { padding-top: 60px; } + diff --git a/public/css/ios7.less b/public/css/ios7.less index 4024582efe..35d595121f 100644 --- a/public/css/ios7.less +++ b/public/css/ios7.less @@ -176,12 +176,12 @@ a { } .github { - background-color: #000; - border-color: #000; + background-color: #666; + border-color: #666; &:focus, &:hover { background-color: transparent; - color: #000; + color: #666; } } diff --git a/views/login.jade b/views/login.jade index a5e028ce4c..280bf015ca 100644 --- a/views/login.jade +++ b/views/login.jade @@ -1,45 +1,46 @@ extends layout block content - .login-container - h3.text-center - span.text-primary PROJECT - span.text-muted NAME - form(method='POST') - .form-group - input.form-control(type='text', name='usernameOrEmail', id='usernameOrEmail', placeholder='Username or Email', autofocus='') - .form-group - input.form-control(type='password', name='password', id='password', placeholder='Password') - button(type='submit') - i.fa.fa-chevron-right - .form-options.clearfix - a.pull-right(href='#') Forgot password? - .text-left - label.checkbox - input(type='checkbox') - span Remember me - .row - .col-xs-6.col-sm-6.col-md-6 - a.btn.btn-primary.btn-block.facebook(href='/auth/facebook') - i.fa.fa-facebook - | Facebook - .col-xs-6.col-sm-6.col-md-6 - a.btn.btn-danger.btn-block.google(href='/auth/google') - i.fa.fa-google-plus - |   Google - .row - .col-xs-6.col-sm-6.col-md-6 - a.btn.btn-info.btn-block.twitter(href='/auth/twitter') - i.fa.fa-twitter - |   Twitter - .col-xs-6.col-sm-6.col-md-6 - a.btn.btn-default.btn-block.github(href='/auth/github') - i.fa.fa-github - |   GitHub - p Don't have an account yet?  - a(href='signup1.html') Sign up now + .login-wrapper + .login-container + h3.text-center + span.text-primary PROJECT + span.text-muted NAME + form(method='POST') + .form-group + input.form-control(type='text', name='usernameOrEmail', id='usernameOrEmail', placeholder='Username or Email', autofocus='') + .form-group + input.form-control(type='password', name='password', id='password', placeholder='Password') + button(type='submit') + i.fa.fa-chevron-right + .form-options.clearfix + a.pull-right(href='#') Forgot password? + .text-left + label.checkbox + input(type='checkbox') + span Remember me + .row + .col-xs-6.col-sm-6.col-md-6 + a.btn.btn-primary.btn-block.facebook(href='/auth/facebook') + i.fa.fa-facebook + | Facebook + .col-xs-6.col-sm-6.col-md-6 + a.btn.btn-danger.btn-block.google(href='/auth/google') + i.fa.fa-google-plus + |   Google + .row + .col-xs-6.col-sm-6.col-md-6 + a.btn.btn-info.btn-block.twitter(href='/auth/twitter') + i.fa.fa-twitter + |   Twitter + .col-xs-6.col-sm-6.col-md-6 + a.btn.btn-default.btn-block.github(href='/auth/github') + i.fa.fa-github + |   GitHub + p Don't have an account yet?  + a(href='/signup') Sign up now - if messages.length - .alert.alert-danger - strong= messages \ No newline at end of file + if messages.length + .alert.alert-danger + strong= messages \ No newline at end of file