Session Authentication in Express

preview_player
Показать описание

We begin with a detailed walkthrough of express-session and its configuration options. Once we set up the sessions, we will wire them up to server routes, which will entail input validation, user lookup, and error handling. We will also protect the routes with guards, or middleware, to check for authenticated users. Finally, we will demo the app, and observe the session lifecycle to nail down the mechanics of session management. We will then conclude with final thoughts about enhancing security and deploying to production.

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

For people who are watching this video : at 20:10 in the newest versions of Express, body-parser package is now built-in in Express. All you need to do is use it as a middleware like this : app.use(express.json()) and true}))

Thanks for the video!

captainalpha
Автор

At first I was like "wow dude this guy is way too fast", but after watching a lot of many other tutorials I realized yours are actually the best ones, straight to the point, while most of the others just do a 2 hours video for something that could've been explained in 30.

I surely can't fully understand this in 40 minutes, but I sure can pause the video and/or rewatch all the parts I didn't get at first and I'll know that I won't waste time since there's no dead moment

Great job and thank you :^D

mautrix
Автор

A year and a half later and this is still *the best* express-session tutorial. By far! Thank you for this Alex!

MarkDeibert
Автор

Also, we can chain our routes if the have the same path like, "/login". Example:
app.route("/login")
.get(function (req, res) {
res.send('Login page"')
})
.post(function (req, res) {
res.send('post login')
});

MichaelAbebreseAgyeman
Автор

This channel is probably the best thing I found on the internet

xdqd
Автор

A BIG THANK YOU for the level of detail and simplicity of this authentication tutorial, it has cleared my confusion on this topic as to when does the client know the user is still connected, or how the session is checked and validated! I've honestly seen this video and watched it on 1.5x before and I didn't get the pointers, so I watched a few more videos on the same topic but got really confused because there's no clear explanation how they validate the session data, how logging in and out works when the session is created/destroyed or how the server uses the session to determine the current user! So I finally watched your video on normal speed, and got the ideas right! I know how JWT authentication works already, it works on the payload, but this session authentication using express has eluded me, so thanks again!

YOUTUBE_IS_WOKE
Автор

Thank you so much alex. From last 3 days i was trying to learn how to implement session based authentication and i failed but from this video, I learned it easily.

ashishsaini
Автор

Thank you for this video. This is a great tutorial, I could learn, understand, and now I'm going to try to implement all the 'to dos' by myself.
Even today, almost 3 years later, It is not so common to find content abou session auth (JWT all over the place), let alone a so well produced material, so congratulations and thank you again.

ThiagoAdomaitis
Автор

I made a ridiculous amount of progress just from a few of your videos! My latest commit is the biggest I've ever made! Keep it up, and thank you!

diegor
Автор

Its good to watch u video. Content is explained very nice and straight to the point. Keep up making more video.

vivekborade
Автор

Great job Alex. Really useful. I was doing well until around 30:00. It got over my head afterwards. But I discovered your new Authentication/Authorization series and will be going those for sure. Thanks for getting me up and going in a very short time. Cheers.

alimahdi
Автор

This is the best video on NodeJS authentication I have seen. Thanks

connormccafferty
Автор

tried many tutorials for authentication.This is by far the best explaination I have listened to.Cheers :)

vigneshpugaz
Автор

Coming from perhaps the absolute beginner in Node, thank you. I not only understood the basics of session management, you helped me improve my workflow as well. Currently trying to adapt this with your suggestions (database, validation, hashing...). Running into issues, but I'm confident I'll crack it soon. I'm grateful. Have a sub.

dcmbassi
Автор

Many many thanks for this tutorial. Ofcourse I understood the principle of cookies but never knew how to use it in my requests. Thanks!

djmonteur
Автор

Saved my life. So many hours and days of struggles and finally I have solved my problem thanks to you! Keep up the good work!

louisruocco
Автор

I'm still in the middle of this.. but this is way too good so far. It's clear, concise and to the point. Thanks for your time buddy!

hawaijarjs
Автор

Hey there! I have to give you a huge thumbs up! This is one of the best tutorials I have ever watched! Everything you said made sense and you didn't speak to hear yourself talk. You got straight to the point and everything was clear and concise. Thank you! I liked and subscribed and will be watching more of your videos. Once again...GREAT JOB! Wish others made excellent tutorials like this one. Take care, Lee

LeeCharles
Автор

This video has been so useful to me that I wish I could 'like' it many times. I've checked it three times already as a refresher. Thank you, Alex. 👍

GeorgesMayrink
Автор

Bro u r seriously amazing. This is the first video I have watched of urs and I am a fan of ur to the point videos with all the minor explanations as well.

Btw I watched at 1.5x speed 😂. Perfect

ritikagrawal