fix(sign-up): Update page for clear onboarding path

Closes #10407
This commit is contained in:
Mrugesh Mohapatra
2017-09-17 14:22:34 +05:30
parent 4c016216b9
commit 6e3f28e770
3 changed files with 3 additions and 64 deletions

View File

@ -163,8 +163,8 @@ module.exports = function(app) {
router.get('/logout', function(req, res) {
res.redirect(301, '/signout');
});
router.get('/signup', getSignin);
router.get('/signin', getSignin);
router.get('/signup', getEmailSignin);
router.get('/signin', getEmailSignin);
router.get('/signout', signout);
router.get('/email-signin', getEmailSignin);
router.get('/deprecated-signin', getDepSignin);
@ -240,15 +240,6 @@ module.exports = function(app) {
app.use('/:lang', router);
app.use(api);
function getSignin(req, res) {
if (req.user) {
return res.redirect('/');
}
return res.render('account/signin', {
title: 'Sign in to freeCodeCamp'
});
}
const defaultErrorMsg = [ 'Oops, something is not right, please request a ',
'fresh link to sign in / sign up.' ].join('');

View File

@ -31,7 +31,7 @@ block content
| using your existing email with us, if you already have an account.
br
p.text-center
a(href="/signin") Or click here if you want to sign in with other options.
a(href="/deprecated-signin") Or click here if you want to sign in with other options.
script.
$(document).ready(function() {

View File

@ -1,52 +0,0 @@
extends ../layout
block content
.text-center
h2 Welcome to freeCodeCamp!
br
.button-spacer
| Sign in or Sign up with one of these options:
a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signin')
i.fa.fa-envelope
| Continue with Email
a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github')
i.fa.fa-github
| Continue with GitHub
br
p
a(href="/deprecated-signin") Or click here if you previously signed up using a different method.
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).text() === obj.method &&
$(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.method = $(this).text();
if(obj.method === "Continue with Email" || obj.method === "Continue in with GitHub") {
localStorage.setItem('lastSigninMethod', JSON.stringify(obj));
} else {
localStorage.removeItem('lastSigninMethod');
}
});
});