Update the Sign in and Sign up Pages

pull/8176/head
Mrugesh Mohapatra 2016-04-18 15:43:35 +00:00
parent 7aeceaf97e
commit aeea02d7fc
No known key found for this signature in database
GPG Key ID: D38A28D5354B173C
4 changed files with 79 additions and 16 deletions

View File

@ -148,6 +148,7 @@ module.exports = function(app) {
router.post('/reset-password', postReset);
router.get('/email-signup', getEmailSignup);
router.get('/email-signin', getEmailSignin);
router.get('/deprecated-signin', getDepSignin);
router.get(
'/toggle-lockdown-mode',
sendNonUserToMap,
@ -225,6 +226,15 @@ module.exports = function(app) {
res.redirect('/');
}
function getDepSignin(req, res) {
if (req.user) {
return res.redirect('/');
}
return res.render('account/deprecated-signin', {
title: 'Sign in to Free Code Camp using a Deprecated Login'
});
}
function getEmailSignin(req, res) {
if (req.user) {
return res.redirect('/');

View File

@ -0,0 +1,56 @@
extends ../layout
block content
.text-center
h2 Sign in with one of these options if you used them as your original login methods :
br
a.btn.btn-lg.btn-block.btn-social.btn-facebook(href='/auth/facebook')
i.fa.fa-facebook
| Sign in with Facebook
a.btn.btn-lg.btn-block.btn-social.btn-google(href='/auth/google')
i.fa.fa-google
| Sign in with Google
a.btn.btn-lg.btn-block.btn-social.btn-linkedin(href='/auth/linkedin')
i.fa.fa-linkedin
| Sign in with LinkedIn
a.btn.btn-lg.btn-block.btn-social.btn-twitter(href='/auth/twitter')
i.fa.fa-twitter
| Sign in with Twitter
br
p
strong IMPORTANT NOTICE
br
em These options are under deprecation and will be removed soon.
br
em After you are signed in, go to the settings page and add GitHub and/or Email as your sign in option
script.
$(document).ready(function() {
var method = localStorage.getItem('lastSigninMethod'),
btnSelector = 'a.btn.btn-lg.btn-block.btn-social';
if (method) {
try {
var obj = JSON.parse(method);
} catch(e) {
console.error('Invalid sign in object stored', method);
return;
}
$.each($(btnSelector), function(i, item) {
if (
$(item).attr('href') === obj.methodLink &&
$(item).hasClass(obj.methodClass)
) {
$(item).addClass('active');
$(item).attr('title', 'This is your last signin method');
return false;
}
});
}
$(btnSelector).click(function() {
var obj = {};
$(this).removeClass('active');
obj.methodClass = $(this).attr('class').split(' ').pop();
obj.methodLink = $(this).attr('href');
localStorage.setItem('lastSigninMethod', JSON.stringify(obj));
});
});

View File

@ -14,7 +14,7 @@ block content
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/settings')
| Update your settings
.col-xs-12
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/logout')
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/signout')
| Sign me out of Free Code Camp
.col-xs-12
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')

View File

@ -2,26 +2,23 @@ extends ../layout
block content
.text-center
h2 Sign in with one of these options:
a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signin')
i.fa.fa-envelope
| Sign in with Email
a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github')
i.fa.fa-github
| Sign in with GitHub
a.btn.btn-lg.btn-block.btn-social.btn-facebook(href='/auth/facebook')
i.fa.fa-facebook
| Sign in with Facebook
a.btn.btn-lg.btn-block.btn-social.btn-google(href='/auth/google')
i.fa.fa-google
| Sign in with Google
a.btn.btn-lg.btn-block.btn-social.btn-linkedin(href='/auth/linkedin')
i.fa.fa-linkedin
| Sign in with LinkedIn
a.btn.btn-lg.btn-block.btn-social.btn-twitter(href='/auth/twitter')
i.fa.fa-twitter
| Sign in with Twitter
br
p
a(href="/email-signup") Or sign up using your email address here.
p
a(href="/email-signin") If you originally signed up using your email address, you can sign in here.
a(href="/deprecated-signin") Or click here to signin with one of the deprecated methods.
h2 New to Free Code Camp ? Sign up now:
a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup')
i.fa.fa-envelope
| Sign up with Email
a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github')
i.fa.fa-github
| Sign up with GitHub
script.
$(document).ready(function() {