Session-Based Authentication - Explanation + Full Node.js Tutorial

preview_player
Показать описание
We're gonna learn login and logout functionalities, protect routes using middleware, send logged user details to views and more.

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

I now consider your videos a must watch for my learning. You're a legend.

aneeshbakshi
Автор

Such quality videos from your channel. Thank you

keshavakumar
Автор

Been looking for a video like this. All the ones I’ve seen are a little advanced and they already have the code written which I hate. This was perfect 👍🏾 easy and simple and covers the basic.

dannny
Автор

great one again. I also consider your videos a must watch for my learning. just because of less views please don't stop to create content.

blank_bow
Автор

Excellent and enjoyable explanation as always. I hope you continue with this wonderful lesson. I have a question that I hope you can answer: How can I prevent a user from logging in to the same account from different devices, or how can I control login sessions?

I searched and found two methods to do this, but they are impractical.

The first method: Upon user login, I save the refresh token in the database, and upon logout, I delete the refresh token from the database. The problem with this method is that if the user deletes the refresh token from the browser, they won’t be able to log in again because, from the backend's perspective, the user is still logged in.

The second method: I use a unique code for each device, and the only way to do this is by using a library like express-useragent, user-agents, ua-parser-js, or useragent. However, these libraries have many issues, including the possibility that two different users might end up with identical codes.

Is there a solution to this problem? I hope you can make a video about this topic and how to control the number of user sessions.

seifeldintarek
Автор

Great video once again, one question, when performing a user registration we can use bcrypt to save the password and compare when the user wants to login right?

gregscolumn
Автор

U r a gem dude .No doubt in that.Plz tell me which authentication is better, authentication with jwt or this one . Actually I am implementing Matrimony MERN STACK application .So I want suggestions

danieljsadananda
Автор

sir do you have a PC or a laptop? Please share its specifications, and if you have both, kindly share the specs of both

snacksports