fix(auth): Remove deprecated views and routes
This commit is contained in:
committed by
Stuart Taylor
parent
6fad6f92a0
commit
38bcc2e250
@ -21,7 +21,7 @@ if (isSignUpDisabled) {
|
||||
|
||||
module.exports = function enableAuthentication(app) {
|
||||
// enable loopback access control authentication. see:
|
||||
// loopback.io/doc/en/lb2/Authentication-authorization-and-permissions.html
|
||||
// loopback.io/doc/en/lb2/Authentication-authorization-and-permissions.html
|
||||
app.enableAuth();
|
||||
const ifUserRedirect = ifUserRedirectTo();
|
||||
const ifNoUserRedirectHome = ifNoUserRedirectTo(homeURL);
|
||||
@ -32,11 +32,14 @@ module.exports = function enableAuthentication(app) {
|
||||
router.get('/signup', (req, res) => res.redirect(301, '/signin'));
|
||||
router.get('/email-signin', (req, res) => res.redirect(301, '/signin'));
|
||||
router.get('/login', (req, res) => res.redirect(301, '/signin'));
|
||||
router.get('/deprecated-signin', (req, res) => res.redirect(301, '/signin'));
|
||||
|
||||
router.get('/logout', (req, res) => res.redirect(301, '/signout'));
|
||||
|
||||
router.get('/signin',
|
||||
ifUserRedirect,
|
||||
(req, res) => res.redirect(301, '/auth/auth0'));
|
||||
ifUserRedirect,
|
||||
(req, res) => res.redirect('/auth/auth0')
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/update-email',
|
||||
@ -71,14 +74,6 @@ module.exports = function enableAuthentication(app) {
|
||||
});
|
||||
});
|
||||
|
||||
router.get(
|
||||
'/deprecated-signin',
|
||||
ifUserRedirect,
|
||||
(req, res) => res.render('account/deprecated-signin', {
|
||||
title: 'Sign in to freeCodeCamp using a Deprecated Login'
|
||||
})
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/accept-privacy-terms',
|
||||
ifNoUserRedirectHome,
|
||||
|
@ -3,7 +3,8 @@ import helmet from 'helmet';
|
||||
let trusted = [
|
||||
"'self'",
|
||||
'https://search.freecodecamp.org',
|
||||
'https://*.algolianet.com'
|
||||
'https://*.algolianet.com',
|
||||
'https://' + process.env.AUTH0_DOMAIN
|
||||
];
|
||||
|
||||
const host = process.env.HOST || 'localhost';
|
||||
|
@ -1,21 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.container
|
||||
.col-xs-12
|
||||
.row
|
||||
.text-center
|
||||
br
|
||||
h4 Select from the following deprecated sign in methods to access your account and add a valid email address to it.
|
||||
br
|
||||
a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github')
|
||||
i.fab.fa-github
|
||||
| Sign in with GitHub
|
||||
a.btn.btn-lg.btn-block.btn-social.btn-facebook(href='/auth/facebook')
|
||||
i.fab.fa-facebook
|
||||
| Sign in with Facebook
|
||||
a.btn.btn-lg.btn-block.btn-social.btn-google(href='/auth/google')
|
||||
i.fab.fa-google
|
||||
| Sign in with Google
|
||||
a.btn.btn-lg.btn-block.btn-social.btn-twitter(href='/auth/twitter')
|
||||
i.fab.fa-twitter
|
||||
| Sign in with Twitter
|
@ -1,20 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.container
|
||||
.col-xs-12
|
||||
.row
|
||||
.text-center
|
||||
h2 Sign up (or sign in with your existing account)
|
||||
br
|
||||
br
|
||||
br
|
||||
a.btn.btn-lg.btn-primary(href='/auth/auth0')
|
||||
| Continue with your email
|
||||
.row
|
||||
.text-center
|
||||
br
|
||||
br
|
||||
br
|
||||
br
|
||||
a(href="/deprecated-signin")
|
||||
| Continute with an old sign in method, that you used previously.
|
Reference in New Issue
Block a user