Merge branch 'raisedadead-feature/passwordless-login' into staging
This commit is contained in:
@ -148,6 +148,7 @@ module.exports = function(app) {
|
|||||||
router.post('/reset-password', postReset);
|
router.post('/reset-password', postReset);
|
||||||
router.get('/email-signup', getEmailSignup);
|
router.get('/email-signup', getEmailSignup);
|
||||||
router.get('/email-signin', getEmailSignin);
|
router.get('/email-signin', getEmailSignin);
|
||||||
|
router.get('/deprecated-signin', getDepSignin);
|
||||||
router.get(
|
router.get(
|
||||||
'/toggle-lockdown-mode',
|
'/toggle-lockdown-mode',
|
||||||
sendNonUserToMap,
|
sendNonUserToMap,
|
||||||
@ -225,6 +226,15 @@ module.exports = function(app) {
|
|||||||
res.redirect('/');
|
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) {
|
function getEmailSignin(req, res) {
|
||||||
if (req.user) {
|
if (req.user) {
|
||||||
return res.redirect('/');
|
return res.redirect('/');
|
||||||
|
56
server/views/account/deprecated-signin.jade
Normal file
56
server/views/account/deprecated-signin.jade
Normal 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));
|
||||||
|
});
|
||||||
|
});
|
@ -14,7 +14,7 @@ block content
|
|||||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/settings')
|
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/settings')
|
||||||
| Update your settings
|
| Update your settings
|
||||||
.col-xs-12
|
.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
|
| Sign me out of Free Code Camp
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')
|
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')
|
||||||
|
@ -1,27 +1,32 @@
|
|||||||
extends ../layout
|
extends ../layout
|
||||||
block content
|
block content
|
||||||
.text-center
|
.text-center
|
||||||
h2 Sign in with one of these options:
|
h2 New to Free Code Camp?
|
||||||
|
br
|
||||||
|
.button-spacer
|
||||||
|
| 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
|
||||||
|
.spacer
|
||||||
|
hr
|
||||||
|
.spacer
|
||||||
|
h2 Are you a returning camper?
|
||||||
|
br
|
||||||
|
.button-spacer
|
||||||
|
| 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')
|
a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github')
|
||||||
i.fa.fa-github
|
i.fa.fa-github
|
||||||
| Sign in with 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
|
br
|
||||||
p
|
p
|
||||||
a(href="/email-signup") Or sign up using your email address here.
|
a(href="/deprecated-signin") Click here if you previously signed in using a different method.
|
||||||
p
|
|
||||||
a(href="/email-signin") If you originally signed up using your email address, you can sign in here.
|
|
||||||
|
|
||||||
script.
|
script.
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
Reference in New Issue
Block a user