NodeJS API Authentication using JWT Tokens

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


This video can be combined with other videos:

00:00 Intro
00:37 Project Setup
02:48 Database (MongoDB)
06:09 Register
13:26 Login
22:44 Authenticated User
27:46 Logout

#node #nodejs #javascript #express
Рекомендации по теме
Комментарии
Автор

Thank you, I have learned a lot, setting up a nodejs/expressjs server and handle all of the route functionality is cool but tedious, that's why serverless is popular these days, it takes care of the repetitive work for us, anyhow, it is always good to know how to setup a server and handle all of the tasks ourselves, great tutorial 😀

maskman
Автор

Thanks I always learn with you, what a great programmer you are.

Greetings from Colombia

jonathancolorado
Автор

tks u so much, u are a lifesaver, i was looking for this the whole day <3

tuphamanh
Автор

Finally a great, complete and working tutorial. Really thank you

giorgiobrugnone
Автор

Awesome! Concise and straight forward!

SkyeJaeson
Автор

Great video. It truly saved a lot of hassle. Thank you.

nimitbhatia
Автор

Thank you so much! Great video. Waiting for NestJS implementation. Also try argon2 instead of bcryptjs, its algorithm is better and there isn't a need for generating salt in case of argon2, just hash and unhash.

rahulsriram
Автор

For whom getting jwt undefined in /user

In your router file, write this:

const cookieParser = require("cookie-parser")
Then add:

router.use(cookieParser());
and remove same this code from your App.js file

sohamwaglekar
Автор

sir at 12:05, when I try to test in postman and click send, it was loading forever with the statement in terminal:

"message": "Operation `users.insertOne()` buffering timed out after 10000ms"

Can you please tell me how to solve this?

maicuong
Автор

the thing that I dont understand is why we store the user info in the cookies. Why didnt we created any session for that?. Great video. love it

furkantekinay
Автор

That is really helpful, thanks a lot!!

rumble_bird
Автор

27:37 this happens because the data we want to get can be displayed by using this syntax const {password, ...data} = user._doc;
res.send(data)

podSnippets_
Автор

What is the reason for not set the token to auth request header as bearer token?

danangsatriani
Автор

Very good tutorial. Thank you for this! I don't really get where to store the secretKey. Can you explain again?

makkujapan
Автор

Hello, thank you for the tutorial. I have one question. For example, we have a user with N products. How to use this cookie to fetch all products belonging to the logged in user ?

nnagap
Автор

I am having trouble connecting this to the frontend react part.... how can we connect this to the frontend????

ainneo
Автор

For some reason when I use the webpost it doesn't receive or send the id as shown in the video. Is it because I use the site or do I have to install it?

samuelsaturno
Автор

Is it okay to request for a video of this with fastify being used?

jamols
Автор

Nice tutorial... how about refresh token...and a react/redux front end?

andrewaghoghovwia
Автор

This is great but Need help with an issue I am facing with this,
I hosted the BE on Aws EC2, and this works great on my localhost frontend app,

But as soon as I host the FE on Aws S3, the cookie doesnt get set in the browser anymore, also there is the warning sign near the cookie in the Login response header. So none of my next requests are working after that as their request header does not have the cookie. (Works perfectly on my localhost)
Does anyone know why ?

jeetadhikari
visit shbcf.ru