NodeJS - ExpressJS Routers for Better Control - Tutorial 15

preview_player
Показать описание
In this final tutorial of the series we prep our webapp for our next tutorial series! By using ExpressJS Routers we separate our authentication routes from our secure routes allowing both to be managed more easily.

Coming up next: Developing a Front End using AngularJS!

Please comment on any questions or suggestions you may have for this or future videos!

If you liked this video and want to catch more like it, hit that SUBSCRIBE button! Thanks rocks-stars!

These tutorials are for educational purposes only. Code demonstrated in these tutorials should not be used in production environments without modification for security and/or performance.

Рекомендации по теме
Комментарии
Автор

Literally the best node and angular tutorial in Youtube (I'm not exaggerating). Managed to compress complex concepts into simple and easy to follow lessons. It definitely did not waste my time like many other tutorials. Quality it is. Thanks for doing this!

albarleta
Автор

Great series! Thanks for the upload and please continue the good work, I would love to see more from you.

Shark_irene
Автор

really useful stuff, thanks very much for putting it all here, you know for any app development these are fundamental steps - tahnks a lot for taking time and sharing it to community, all the best

contactmsr
Автор

Great series, you're a really good teacher, I found it super easy to understand what you talked about. Thanks!

josantorres
Автор

Good help. This was very helpful. I'll be watching it again tomorrow. Thanks.

riclf
Автор

Thank you. Great tutorials. I wish you will add more videos.

rokec
Автор

Excellent tutorials, you should continue to make this series until the completion of wabapp, and approach all the topics related to the MEAN development. Thanks for value information.

santiagolozanopena
Автор

hi,
thanks lot about video, can i ask you hou you can spearate cleary your front end from backend because you use angularjs the view folder shoing in video it about express js folder not angular?

issuessolution
Автор

+Brent Aureli -
Hey, a small question

e.g. when i click on the login button and my password was false, then i go back to the main page...

A way to solve this, was by changing '/login" with "/auth/login"

router.post('/login', passport.authenticate('local-login', {
successRedirect : '/profile',
failureRedirect : '/auth/login',
failureFlash : true
}));

the same also counts for the signup, ... any idea what the issue could been?

dieterverbeemen
Автор

If you select a word for example "app" (minute: 2:57), then ctrl + d, subl will select all the words that match, also creating the multiple cursor for each word found.

programacionC
Автор

Hi Brent,

For facebook and google, you follow a login / signup strategy in one route. For local login and signup two seperated routes. Could they be combined to one route? I tried to add an radio button with a value 'login' or 'signup' and catch them with middleware. This works, but how do I proceed to the right passport - strategy: Pattern: router.post('route', function(req, res, next){ if(req.body.action === 'login'} -> else ->

benstuijts
Автор

Help! I hate to say this because it will display my ignorance! ;) However.... For the Local Logon I find there is a logic error-

From the Home Page you click the Local Login button and get to the Login Page. There you enter your email and password and click the Login button. Control goes to router.use in the secure.js module. It tests to see of the user isAuthenticated. The user is wanting to login and so is not yet authenticated, so it falls through to the end of router.use and redirects to '/auth'.

Its a circle you can't get out of. It seems that when router.use sees that the user is not yet authenticated it should inspect the target url and see '/login', and then skip the redirect, letting it pass through. Am I missing something here? Thanks.

riclf
Автор

Hi Brent,

Are you planning on releasing new tutorials any time soon?

simoprdev
Автор

Can I omit the "/auth" and "/secure"  paths by using something like this:

app.use('/', function (req, res, next) {
    var router = express.Router()
    if(req.isAuthenticated()) {
        require('./app/routes/secure')(router, passport)
        app.use('/', router)
    }
    else {
        require('./app/routes/auth')(router, passport)
        app.use('/', router)
    }
})

MichaelSeltenreich
Автор

i have one question if its alright mate.

i have followed the node tutorial right through and loved it but i am having an issue with implementing ui.router to make a one page application. how do i use this authentication with ui.router?

nathanmason