PLEASE keep making courses! I would love a full stack course using React and Express, with either PostgreSQL or MongoDB. Your teaching style is one of the best I have found!!
Thank you for the "long winded" explanation of how you came to getting the errors out of the object. That was extremely helpful for me in understanding what exactly is going on.
Errors handling explanation was simply outstanding. After this episode I'm certain if I was about to buy a course from you, that would be greatly invested money.
I got to learn so much from this video! My mind has been blown. This is soo good, thank you very much ninja I really like how you clear things up so easily :)
Nice tutorial! Just to point out - you can achieve the same way of functionality (model definitions, validation etc.) with Sequelize and MySQL (if you need to work with Relation database). The tutorial still applies for this "configuration" as well.
Brilliant and straightforward explanations. I could feel this is a hard topic and yet still you've made me understand pretty much everything that's going on. Maybe there's a little more practice needed to grasp it entirely. Thanks
I am excited to see how shaun will use jwt token to use from front end. Will you save in localstorage, session or cookies i cant wait man for that part.. rest nice one man.
Hi , great video ! but I have a simple problem which is when I have invalid email and password like you did in the first 10 minutes , I have a validation for just the email . why is that
What should I do next Can you make a pathway video to know how should we follow your playlist from your channel for every technology covered on your channel?
You can add this to the password json to require numbers in the password: validate: [(val) => { return /\d/.test(val); }, "Please make sure your password contains at least one number!"]
Doesn't returning from the duplicate email error imply that even if the user had a invalid password, he would never be notified of this at the same time as the duplicate email error? In other words, he would have to resolve the email error before being able to see the password error? Also, a bit of a beginner question : when you destructured the properties property, why is it that it was asking you for parentheses? Shouldn't the curly braces by themselves suffice or is there something which I'm missing? Thanks
I think it's because JS will think { properties } is the start of the **what to do for each** function. Placing it in a parenthesis means, it will interpret it as a placeholder for each item. Hope this makes sense.
Nice video. In case of mobile devices. How u prefer manage about security and authentications. U think that its better that user can "correct authenticactions " in many devices or Only one device, like one session at a time User can login in multiple devices at same time or only the last authenticacion is correct?
That depends on your requirements. if you need to be able to login from multiple devices, then store the token and device information so that the user can check their sessions. Otherwise overwrite their token with a new one each login. One login token is of course more secure just because there is less devices to worry about.
Hello shaun, i'm joseph and i really want to learn programming and i saw your beginners html and css course and i love them and i was thinking of watching all your videos from the very first to now but i'm also thinking its a waste of time and i should just start with the modern once like the html crash course or the angular 2 instead of angular js i just really need to hear from you so pls reply i'm desprate thank you
Hey, thanks :). Yeah some of the modern ones might be a good choice. I would maybe suggest a responsive build one, and also things like css grid. Angular is more advanced so I would definitely learn javascript first. I have a modern javascript playlist on here as well for that plus lots of others :)
Sorry, but shouldn't there be validation checks on the client? Otherwise, on the server with such checks, the response loads in more than 100 milliseconds, and that's bad.
I made this function for handle errors, I think is more dynamic. const HandleErrors = (err) => { const errorList = {}; if (err['code'] != undefined) { for(let x in err){ const keyValue = Object.keys(err['keyValue'])[0]; if(err['code'] === 11000){ errorList[keyValue] = `There is an user with the ${keyValue} repeated.` } } } else { const errorJson = err['errors']; for (let x in errorJson) { errorList[x] = errorJson[x]['properties']['message']; } } return errorList; }
Dude you're awesome. You motivated me to do code 😜. I've been thinking a lot about auction site. Could you make a tutorial about a simple auction? It would be cool
PLEASE keep making courses! I would love a full stack course using React and Express, with either PostgreSQL or MongoDB. Your teaching style is one of the best I have found!!
Thank you for the "long winded" explanation of how you came to getting the errors out of the object. That was extremely helpful for me in understanding what exactly is going on.
Errors handling explanation was simply outstanding. After this episode I'm certain if I was about to buy a course from you, that would be greatly invested money.
this is amazing the way he explains something as simple as error handling in depth is just remarkable.
The Net Ninja : I can do this all day!
lol
This lecture is gold. Thank you Shaun!
This guy aint gonna stop and i love it
I got to learn so much from this video! My mind has been blown. This is soo good, thank you very much ninja I really like how you clear things up so easily :)
Nice tutorial!
Just to point out - you can achieve the same way of functionality (model definitions, validation etc.) with Sequelize and MySQL (if you need to work with Relation database). The tutorial still applies for this "configuration" as well.
As always, the master is back rocking, this time with JWT! Eagerly looking forward..........
This is the first video of yours where I can hear you typing. I thought someone was knocking on my front door. I, no joke, got up and checked hahaha
He got a mechanical keyboard.
Brilliant and straightforward explanations. I could feel this is a hard topic and yet still you've made me understand pretty much everything that's going on. Maybe there's a little more practice needed to grasp it entirely. Thanks
Glad it was helpful! :)
Ughhhhh what a steal, Properties destructuring in the foreach .. zbagliato. Stunning
What a properly brilliant tutorial/course. I'm loving it.
Thank you! :)
None explain better than you. You're an absolute star!
errors[properties.path] = properties.message is a very smart way of dealing with it. i was a bit mindblown
Mongoose Validation video was really awesome , Thanks once again
Wow.. didn't know you can use validation in mongoose. I always used 3rd party whenever I create apis. thanks shaun!
loving this series.
Net Ninja bro, thanks for the tut. You are so great at teaching. Give you 1000 like. This thing deserve million views
U're genious, shaun!
I am excited to see how shaun will use jwt token to use from front end. Will you save in localstorage, session or cookies i cant wait man for that part.. rest nice one man.
Binge watching your react js tutorials... Thank you for this 👍☕☕☕
Here you go
Thanks Shaun for the great video :D
Nice explanation about errors and mongoose validation. 👍
Thks Shaun for these great videos ! Smooth, precise and clear. (=
This chapters basically explained that its enough internet for today :D
shouldn't the email syntax validation and password length and these thing be validated at the front end?
thank you bro , your tutorials is very useful ❤
Thank you so much for this life changing video
You're so welcome! :)
you are a HERO
Amazing tutorials great job thank you!!
Thanks for your support Saleem :)
"Node Auth tutorial with JWT plus a crash course on MongoDB & Node" :'D
Very nice tutorial!
Thank you!
Great series! Thanks.
90% to yaha Indians hi hai...👍👍👍
Did he understand it?😂
Yes
Ghanta 90% instead 20 - 30% hoga buss, because we are indians whole day === shit tiktok
Looking forward to the next video
Hi , great video ! but I have a simple problem which is when I have invalid email and password like you did in the first 10 minutes , I have a validation for just the email . why is that
What should I do next
Can you make a pathway video to know how should we follow your playlist from your channel for every technology covered on your channel?
You can add this to the password json to require numbers in the password:
validate: [(val) => {
return /\d/.test(val);
}, "Please make sure your password contains at least one number!"]
Doesn't returning from the duplicate email error imply that even if the user had a invalid password, he would never be notified of this at the same time as the duplicate email error? In other words, he would have to resolve the email error before being able to see the password error? Also, a bit of a beginner question : when you destructured the properties property, why is it that it was asking you for parentheses? Shouldn't the curly braces by themselves suffice or is there something which I'm missing? Thanks
I think it's because JS will think { properties } is the start of the **what to do for each** function. Placing it in a parenthesis means, it will interpret it as a placeholder for each item. Hope this makes sense.
Shaun, will you include refreshing the JWT token the right way? It is often skipped in many tutorials.
Great content. Thanks a lot.
Thanks for great video ✌🤟🤞
Hello shaun, can u make a live video how you study something like new tech?
The method is really awesome !!!! Loved it . 💌from Bangladesh !!💌
Thank you! Cheers! :)
what about using Joi for validation?
I think this videos are coming quicker than bullets. I need notebook to catch except later. Thanks.
Expert stuff!
How to validate if type is object instead of string?
Nice video. In case of mobile devices.
How u prefer manage about security and authentications.
U think that its better that user can "correct authenticactions " in many devices
or Only one device, like one session at a time
User can login in multiple devices at same time or only the last authenticacion is correct?
That depends on your requirements.
if you need to be able to login from multiple devices, then store the token and device information so that the user can check their sessions. Otherwise overwrite their token with a new one each login.
One login token is of course more secure just because there is less devices to worry about.
@@K-IA thank u man,
I think the 1st case its ok with sessions data register like device time and location
you are my hero!!
Can you also mention in a video on how to confirm password
explanation is lit
We are so lucky that we are getting this for free
that went from 0 to 100. everything made a lot of sense until the error handling. then it just felt like mumbo jumbo and following along
Hello shaun, i'm joseph and i really want to learn programming and i saw your beginners html and css course and i love them and i was thinking of watching all your videos from the very first to now but i'm also thinking its a waste of time and i should just start with the modern once like the html crash course or the angular 2 instead of angular js i just really need to hear from you so pls reply i'm desprate thank you
Hey, thanks :). Yeah some of the modern ones might be a good choice. I would maybe suggest a responsive build one, and also things like css grid. Angular is more advanced so I would definitely learn javascript first. I have a modern javascript playlist on here as well for that plus lots of others :)
i thought ur gonna use bcrypt to hash password. Well now im looking forward to see mongoose hooks
Object.values()not working how to resolve it??
Sorry, but shouldn't there be validation checks on the client? Otherwise, on the server with such checks, the response loads in more than 100 milliseconds, and that's bad.
Anyone gets "User validation failed" with capital 'U'? .includes(' ') is case-sensitive. It took me awhile to figure why the code didn't work.
It's an interesting part, but it's not very clean...
The way to manage with errors is a bit of tinkering.
I made this function for handle errors, I think is more dynamic.
const HandleErrors = (err) => {
const errorList = {};
if (err['code'] != undefined) {
for(let x in err){
const keyValue = Object.keys(err['keyValue'])[0];
if(err['code'] === 11000){
errorList[keyValue] = `There is an user with the ${keyValue} repeated.`
}
}
} else {
const errorJson = err['errors'];
for (let x in errorJson) {
errorList[x] = errorJson[x]['properties']['message'];
}
}
return errorList;
}
That validation is causing the mongoose in a loop:'
fuck, I LOVE THIS GUY
Dude you're awesome. You motivated me to do code 😜. I've been thinking a lot about auction site. Could you make a tutorial about a simple auction? It would be cool
a mern course please
unique: true is not working
When's the next vedio coming???
mongoose hooks to hash password as pre,save. I really didn't grasp that early on. What about passportjs to hash.
I guess : mongoose hooks with bcrypt
@@TechnoDB yes bcryptjs, ani bro Android rooting ko video sai thiyo.
@@bijayaadhikari442 : hehe.. Thank you bro.
tyo video 2/3 years huna laagexa aba ta ))
@@TechnoDB yap, I analysed that you have good explaination and voice. You should try an application from frontend to backend as you learn.
I mean making video.
I found a little bug. If you set a duplicate email and a short password, only the password error will be handled
yup!
coz validation occurs before going to the database!!
It would be great if you could use (www.npmjs.com/package/joi) JOI validator instead
const errors = {};
for (key in error.errors) {
const { message } = error.errors[key];
errors[key] = message;
}
res.json(errors);
console.log(errors);
thanks
imba mode
ty.
Salamat..,
I guess its goodbye to @hapi/joi
Is it just me or did Shaun just go trigger happy with his error message function midway through the video?
👍👍
Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic Epic
💖💖💖💖💖💖💖💖
Too complex!
Skill issue
this is amazing the way he explains something as simple as error handling in depth is just remarkable.