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
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.
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 😀
First check the links in the description of the video, there I have the react frontend. Second I didn't include refresh token and redux because I wanted everything to be simple.
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?
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 ?
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 ?
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?
sir make Protect route. Login user can't access Signup page. if user already Login in then don't go to login page again. and other route protect. If not login don't go home page or other routes and make Video store Token in Mongodb Database and delete from there and verify from there. and Token expire date etc. and make video Authentication with Facebook and Google In Node Js also.
I think your are mix all, if you use vuejs for exemple you should handle that with vuejs this is a api only give status of the pages and data i think the goal was that!
I am getting this error on post register: C:\Angular\product-display-system-cms\backend ode_modules\bcryptjs\dist\bcrypt.js:214 nextTick(callback.bind(this, Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)))); ^ Error: Illegal arguments: undefined, string at _async (C:\Angular\product-display-system-cms\backend ode_modules\bcryptjs\dist\bcrypt.js:214:46) at C:\Angular\product-display-system-cms\backend ode_modules\bcryptjs\dist\bcrypt.js:223:17 at new Promise () at bcrypt.hash (C:\Angular\product-display-system-cms\backend ode_modules\bcryptjs\dist\bcrypt.js:222:20) at C:\Angular\product-display-system-cms\backend outes outes.js:7:41 Any suggestions on how to fix this? Thank you!
i have this error in post('/login) in const user = User.findOne({email:req.body.email}) TypeError: Cannot read properties of undefined (reading 'findOne') help me please
Awesome! Concise and straight forward!
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
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.
Thank you for the tip, I will change them in my future videos. The NestJS Video will be uploaded after 2 weeks, 1st of March.
Finally a great, complete and working tutorial. Really thank you
Thanks I always learn with you, what a great programmer you are.
Greetings from Colombia
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 😀
tks u so much, u are a lifesaver, i was looking for this the whole day
Great video. It truly saved a lot of hassle. Thank you.
Very clear, thank you for the video.
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
Thanks 🙌 Best lesson
truly helpful..
thank you!
Great video.Thanks.
That is really helpful, thanks a lot!!
Very good tutorial. Thank you for this! I don't really get where to store the secretKey. Can you explain again?
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)
You can make one with MySQL and
typeorm? All in typescript with interfaces implementation?
Nice tutorial... how about refresh token...and a react/redux front end?
First check the links in the description of the video, there I have the react frontend. Second I didn't include refresh token and redux because I wanted everything to be simple.
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?
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 ?
Big thanks!
I am having trouble connecting this to the frontend react part.... how can we connect this to the frontend????
the JWT cookie displayed in POSTMAN but not in Browser, what can i do ? i am using Vue
elon musktache
const cookie = req.cookies['jwt']
TypeError: Cannot read properties of undefined (reading 'jwt')
Thank you 🙏
What is the reason for not set the token to auth request header as bearer token?
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 ?
Thank you :)
Thank you so much
Is it okay to request for a video of this with fastify being used?
hii it is absolutely great but I wanted help to connect this node.js backend to react frontend, can anyone help
I can’t delete cookie! Please help
Great
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?
will this work with the React JWT Authentication code?
yes, it will work with all the links provided in the description
What is this cookie for?
sir make Protect route. Login user can't access Signup page.
if user already Login in then don't go to login page again.
and other route protect. If not login don't go home page or other routes
and make Video store Token in Mongodb Database and delete from there and verify from there. and Token expire date etc.
and make video Authentication with Facebook and Google In Node Js also.
I think your are mix all, if you use vuejs for exemple you should handle that with vuejs this is a api only give status of the pages and data i think the goal was that!
👏👏👍
thanks, like + subscribe
I am getting this error on post register:
C:\Angular\product-display-system-cms\backend
ode_modules\bcryptjs\dist\bcrypt.js:214
nextTick(callback.bind(this, Error("Illegal arguments: "+(typeof s)+', '+(typeof salt))));
^
Error: Illegal arguments: undefined, string
at _async (C:\Angular\product-display-system-cms\backend
ode_modules\bcryptjs\dist\bcrypt.js:214:46)
at C:\Angular\product-display-system-cms\backend
ode_modules\bcryptjs\dist\bcrypt.js:223:17
at new Promise ()
at bcrypt.hash (C:\Angular\product-display-system-cms\backend
ode_modules\bcryptjs\dist\bcrypt.js:222:20)
at C:\Angular\product-display-system-cms\backend
outes
outes.js:7:41
Any suggestions on how to fix this? Thank you!
i have this error in post('/login)
in const user = User.findOne({email:req.body.email})
TypeError: Cannot read properties of undefined (reading 'findOne')
help me please