Building Node.js Authentication from Scratch

  Рет қаралды 185,821

Piyush Garg

Piyush Garg

Күн бұрын

Пікірлер: 149
@targetwithsunilhooda
@targetwithsunilhooda Күн бұрын
The Best Teacher 👍👍👍👍👍👍 Itna achha to Paid Course me bhi content nhi milta
@KrishnaKumar-kh5iu
@KrishnaKumar-kh5iu 9 ай бұрын
🎯 Key Takeaways for quick navigation: 00:00 🛠 *Node.js Authentication Basics* - Introduction to authentication patterns in Node.js. - Two basic patterns discussed: Stateful and Stateless authentication. 01:07 🚗 *Authentication Analogy: Parking Ticket* - Illustration of stateful authentication using a parking attendant analogy. - Comparison between providing a parking ticket and receiving a unique ID for server-side data maintenance. 02:02 🎟 *Stateless Authentication: Diary Entry* - Explanation of stateless authentication using the example of a parking ticket without server-side data storage. - Analogous process of generating and validating unique IDs for accessing resources. 03:38 🔄 *Transition to Server-Side Authentication* - Transition from client-side to server-side authentication process. - Example of a client sending a request with user credentials to the server for authentication. 04:09 📝 *Server-side session management* - Understanding session IDs and their management on the server-side, - Sending session IDs along with requests for server authentication, - Utilizing cookies or headers for transferring unique IDs and managing authentication. 06:02 🛠 *Implementing authentication in the application* - Setting up authentication middleware in the Express application, - Validating tokens and unique IDs for authentication, - Incorporating user data and authentication parameters into the application model. 08:52 🛠 *Creating Authentication Routes* - Setting up authentication routes in Node.js. - Creating a user model and defining routes for signup. - Implementing controller functions for user signup. 10:13 📝 *User Signup Validation* - Validating user input such as password length and email format. - Handling user signup requests and responses. - Importing user model and returning appropriate responses. 11:50 📲 *Handling User Registration* - Implementing registration functionality for users. - Defining routes and handling user registration requests. - Creating user signup forms with input validation. 14:17 🛠 *Handling user sign-up form submission* - Understanding form action and method, - Troubleshooting form submission errors and refreshing the page. 16:04 🔑 *Ensuring successful user registration process* - Configuring form redirection after successful registration, - Implementing conditional logic for user access based on authentication status. 17:11 🚦 *Validating user credentials and redirecting* - Validating user input for email and password, - Implementing error handling and redirecting based on authentication status. 20:07 🛠 *Node.js Authentication Setup* - Setting up authentication process in Node.js, - Generating unique session IDs, - Installing necessary packages and importing them. 21:32 🍪 *Cookie Generation and Handling* - Creating and handling cookies for user sessions, - Utilizing middleware to retrieve cookie values, - Implementing functionality to refresh cookies upon server request. 22:59 📝 *Application Diary and Control Flow* - Demonstrating control flow within the application, - Logging user activities in the application diary, - Managing user sessions and associated data. 24:56 🔒 *Middleware Function for User Authentication* - Implementing middleware function for user authentication, - Accessing user ID from cookies, - Handling redirection based on user authentication status. 27:55 🍪 *Cookie Parsing and Validation* - Parsing and validating cookies for user authentication, - Ensuring proper access control based on URL paths, - Handling cookie-related errors gracefully. 29:02 🛠 *Troubleshooting and Debugging* - Debugging cookie reading and generation issues, - Resolving errors related to undefined properties, - Iterative debugging process for smoother development. 30:27 🛠 *Node.js Authentication Implementation* - Implementing password generation and authentication in Node.js. - Discussion on server restart issues affecting data integrity. - Handling URL generation and user identification securely. 31:48 🔄 *URL Generation and Data Integrity* - Addressing data integrity challenges upon server refresh. - Ensuring correct URL generation and user identification after server restart. - Implementing strategies to maintain data consistency and user authentication. 33:19 🖥 *Dynamic URL Handling and User Identification* - Exploring middleware for dynamic URL handling and user identification. - Adding user-specific references to generated URLs. - Utilizing user IDs for personalized URL management and authentication. 34:44 🔒 *Implementing authentication logic* - Creating middleware function to check authentication status. - Simplifying authentication logic by restricting access. - Handling authentication checks and redirects efficiently. 36:07 🧳 *Setting up user authentication* - Creating a sign-up form with fields for full name, email, and password. - Generating and validating short IDs for user authentication. - Implementing basic authentication workflow and URL handling. 37:57 🚪 *Customizing user access and permissions* - Limiting user access to their own analytics and URLs. - Generating short IDs for user-specific data access. - Ensuring secure and controlled authentication processes.
@pranjalmaurya3832
@pranjalmaurya3832 9 ай бұрын
hey! do you faced the same problem at 29:00 i.e. not being able to generate short urls after login?
@Solo_playz
@Solo_playz 7 ай бұрын
Bhai video se jyada heavy Tera comment hai ☠️
@IamMQaisar
@IamMQaisar 6 ай бұрын
@whyDude123 🤣
@prolifier1
@prolifier1 3 ай бұрын
@@pranjalmaurya3832 is it solved now coz I am facing the same problem
@iamakashkumarram
@iamakashkumarram Жыл бұрын
This is the best NodeJS series ever made.
@not_amanullah
@not_amanullah 8 ай бұрын
agreed 💯
@AkshaySharma-bg3oj
@AkshaySharma-bg3oj 11 ай бұрын
Thanks a lot for availing this series for free, we know it takes hell amount of your time. Thanks mate.
@VarunSharma-xd8xd
@VarunSharma-xd8xd 5 ай бұрын
when i saw this playlist for first time i was frustrated but now i am able to grasp the concepts
@ratishjain2718
@ratishjain2718 11 ай бұрын
Best Nodejs series out there and I am not even kidding how good he teaches
@rishabhraj8233
@rishabhraj8233 10 ай бұрын
yes man @piyush Garg is a god sent man
@mujibulhaquetanim
@mujibulhaquetanim 10 ай бұрын
But don't think that's a full series on Node.js; he covered it yesterday in his live stream.
@Ayush37262
@Ayush37262 10 ай бұрын
​@@mujibulhaquetanim Complete nhi hai kya ye??
@mujibulhaquetanim
@mujibulhaquetanim 10 ай бұрын
This playlist is still suitable for beginners, even though there are still some gaps in the graphql series. He nearly covered every essential topic related to Node.js.@@Ayush37262
@DeepakSingh-u9o8s
@DeepakSingh-u9o8s 4 ай бұрын
Alert : these videos are knowledge heavy so please keep focused 🤯🤯🤯🤯😎😎😎
@KamleshSahu-no4tx
@KamleshSahu-no4tx 2 ай бұрын
I am watching this series in sep 2024 but it is the one of the best series on node js
@iUmerFarooq
@iUmerFarooq Жыл бұрын
Bohot acha sa samjatha ho. Make more projects in Nodejs/Expressjs. Bohot Shukriya
@iamakashkumarram
@iamakashkumarram Жыл бұрын
Sir please cover JWT Authentication and Local Storage in depth.
@muhammadzahir7931
@muhammadzahir7931 4 ай бұрын
banda cool hay. Zabardast analogies use ki bhai. Happy to find a teacher like you. Wandering why your channel is so underrated.
@dhruvsolanki4473
@dhruvsolanki4473 3 ай бұрын
Really amazing explanation, easy to learn because of you.
@imPrathamDev
@imPrathamDev Жыл бұрын
First time I see Gravity Falls and Adventure Time crossover
@Developer-s4z
@Developer-s4z 2 ай бұрын
What does it mean?
@endsudesn6721
@endsudesn6721 2 ай бұрын
​@@Developer-s4z The parking lot example he showed in the beginning used Adventure Time and Gravity Falls Characters.
@ankit1153
@ankit1153 Жыл бұрын
Thank you sir i don't know about how to find data in other collection by user ID but after watching this video i am clear now...
@joy-uw5fd
@joy-uw5fd Ай бұрын
Authentication best tuterial ,,love form bd❤❤
@devnishmishra
@devnishmishra 2 ай бұрын
Badhiya tha acha hua maine mongo node sb padha h warna ghanta smjh aaata lekin passport use karne pe easy ho jata h
@webdeveloper3529
@webdeveloper3529 Жыл бұрын
Wow i cleared my all concepts 😎
@piyushgargdev
@piyushgargdev Жыл бұрын
Great 🚀
@sahildhanawade
@sahildhanawade Жыл бұрын
my doubt apne sessionIdToUserMap object me user ki uid or user ki details store ki hai pr ek time ke baad ye server ki bhot memory kha jayega to es object me se hr user ki details ek time ke baad apne aap delete ho jana chahiye
@ShivendraPratap524
@ShivendraPratap524 Жыл бұрын
sir thanks for the awesome content , but i have a request that please try to explain things , for ex : cookies , etc please , it would help us understand more easily
@piyushgargdev
@piyushgargdev Жыл бұрын
Noted
@shivanshsrivastava5561
@shivanshsrivastava5561 9 ай бұрын
​@@piyushgargdevafter loggin with email and password we are redirected to page to generate shortUrl or shortId but when I enter original url after loggin I am being redirected back to loggin page ,,unable to resolve
@sarfaraz_adil
@sarfaraz_adil 4 ай бұрын
@@shivanshsrivastava5561 hii same problem bro can you please help me
@Saucy_Dragon
@Saucy_Dragon Ай бұрын
@@shivanshsrivastava5561 was having the same problem, check for correct use of const userUid=req.cookies?.uid; in the middleware....and also this condition : const user= await getUser(userUid); if(!user){ return res.redirect("/login");}....is causing this issue as when i login for the first time (even using a previously registered id) user is undefinded......so commenting this condition worked 4 me.....also do not miss a return statement in getUser service
@mma-dost
@mma-dost Жыл бұрын
Great video bhaiya !! Please make more videos asap
@easelogic
@easelogic 5 ай бұрын
Best Series. 👩🏻‍💻👩🏻‍💻
@arbabmemon2095
@arbabmemon2095 Жыл бұрын
You have been doing great job sir
@kanikamehrotra1518
@kanikamehrotra1518 Жыл бұрын
Thankyou so much for the wonderful playlist.
@themystery112
@themystery112 Жыл бұрын
Great Video Thanks Sir
@piyushgargdev
@piyushgargdev Жыл бұрын
Most welcome
@banothutharun2743
@banothutharun2743 2 ай бұрын
what a masterpiece playlist😃
@rishabhkedia9304
@rishabhkedia9304 5 ай бұрын
7:10 16:20 login 20:33 cookie 31:00
@varmapurushotham
@varmapurushotham 6 ай бұрын
Enjoyed the entire video! Lot of learning! Thank you :)
@sweabhishek
@sweabhishek 6 ай бұрын
Key Takeaways for quick navigation: 00:00 Node.js Authentication Basics - Introduction to authentication patterns in Node.js. - Two basic patterns discussed: Stateful and Stateless authentication. 01:07 Authentication Analogy: Parking Ticket - Illustration of stateful authentication using a parking attendant analogy. - Comparison between providing a parking ticket and receiving a unique ID for server-side data maintenance. 02:02 Stateless Authentication: Diary Entry - Explanation of stateless authentication using the example of a parking ticket without server-side data storage. - Analogous process of generating and validating unique IDs for accessing resources. 03:38 Transition to Server-Side Authentication - Transition from client-side to server-side authentication process. - Example of a client sending a request with user credentials to the server for authentication. 04:09 Server-side session management - Understanding session IDs and their management on the server-side, - Sending session IDs along with requests for server authentication, - Utilizing cookies or headers for transferring unique IDs and managing authentication. 06:02 Implementing authentication in the application - Setting up authentication middleware in the Express application, - Validating tokens and unique IDs for authentication, - Incorporating user data and authentication parameters into the application model. 08:52 Creating Authentication Routes - Setting up authentication routes in Node.js. - Creating a user model and defining routes for signup. - Implementing controller functions for user signup. 10:13 User Signup Validation - Validating user input such as password length and email format. - Handling user signup requests and responses. - Importing user model and returning appropriate responses. 11:50 Handling User Registration - Implementing registration functionality for users. - Defining routes and handling user registration requests. - Creating user signup forms with input validation. 14:17 Handling user sign-up form submission - Understanding form action and method, - Troubleshooting form submission errors and refreshing the page. 16:04 Ensuring successful user registration process - Configuring form redirection after successful registration, - Implementing conditional logic for user access based on authentication status. 17:11 Validating user credentials and redirecting - Validating user input for email and password, - Implementing error handling and redirecting based on authentication status. 20:07 Node.js Authentication Setup - Setting up authentication process in Node.js, - Generating unique session IDs, - Installing necessary packages and importing them. 21:32 Cookie Generation and Handling - Creating and handling cookies for user sessions, - Utilizing middleware to retrieve cookie values, - Implementing functionality to refresh cookies upon server request. 22:59 Application Diary and Control Flow - Demonstrating control flow within the application, - Logging user activities in the application diary, - Managing user sessions and associated data. 24:56 Middleware Function for User Authentication - Implementing middleware function for user authentication, - Accessing user ID from cookies, - Handling redirection based on user authentication status. 27:55 Cookie Parsing and Validation - Parsing and validating cookies for user authentication, - Ensuring proper access control based on URL paths, - Handling cookie-related errors gracefully. 29:02 Troubleshooting and Debugging - Debugging cookie reading and generation issues, - Resolving errors related to undefined properties, - Iterative debugging process for smoother development. 30:27 Node.js Authentication Implementation - Implementing password generation and authentication in Node.js. - Discussion on server restart issues affecting data integrity. - Handling URL generation and user identification securely. 31:48 URL Generation and Data Integrity - Addressing data integrity challenges upon server refresh. - Ensuring correct URL generation and user identification after server restart. - Implementing strategies to maintain data consistency and user authentication. 33:19 Dynamic URL Handling and User Identification - Exploring middleware for dynamic URL handling and user identification. - Adding user-specific references to generated URLs. - Utilizing user IDs for personalized URL management and authentication. 34:44 Implementing authentication logic - Creating middleware function to check authentication status. - Simplifying authentication logic by restricting access. - Handling authentication checks and redirects efficiently. 36:07 Setting up user authentication - Creating a sign-up form with fields for full name, email, and password. - Generating and validating short IDs for user authentication. - Implementing basic authentication workflow and URL handling. 37:57 Customizing user access and permissions - Limiting user access to their own analytics and URLs. - Generating short IDs for user-specific data access. - Ensuring secure and controlled authentication processes.
@PubG-dl5eh
@PubG-dl5eh Жыл бұрын
Osm series💥 But can you add the complete authentication like.... Sign up Otp verify Email verify Login ......etc
@piyushgargdev
@piyushgargdev Жыл бұрын
Sure
@thebishalpaul
@thebishalpaul Жыл бұрын
Bhaiya can you plz describe why are we again getting user and checking if user exists (line 8 at 29:14) as, if the user isn't logged in then the UID won't be generated so the first check serves the purpose isn't it? Edit: Found out that on refresh the map obj doesn't reset but on server restart it does. For which the second check is important. Keeping the comment might help someone with same doubt.
@ombandurkar7950
@ombandurkar7950 11 ай бұрын
Thank you for keeping the comment, it helped me
@thebishalpaul
@thebishalpaul 11 ай бұрын
@@ombandurkar7950 happy to help 🙂
@sarfaraz_adil
@sarfaraz_adil 4 ай бұрын
@@thebishalpaul after loggin with email and password we are redirected to page to generate shortUrl or shortId but when I enter original url after loggin I am being redirected back to loggin page ,,unable to resolve can you help me please
@thebishalpaul
@thebishalpaul Жыл бұрын
Understood everything except checkAuth at 35:22 tried using restrictToLoggedInOnly middleware instead of checkAuth the home page redirects to login page but it doesn't load. Can anyone plz help why is it so?
@shubham0546
@shubham0546 10 ай бұрын
Same issue
@Ayush37262
@Ayush37262 9 ай бұрын
What do you mean by "it doesn't load"?? Can you explain in detail...
@vishalranjan2429
@vishalranjan2429 3 ай бұрын
felt like watching a interesting cinema .
@Shakti_singh96
@Shakti_singh96 2 ай бұрын
can we include this in our resume projects??
@sparsh-0384
@sparsh-0384 Жыл бұрын
Well explained... Where I can get the code for reference
@ASHISHKUMAR-de9jn
@ASHISHKUMAR-de9jn Жыл бұрын
Thank you sir ❤
@indrajitnaskar6851
@indrajitnaskar6851 9 ай бұрын
I clone your code ,but the urls that user visited is not working, both users data is showing, please some one help me
@lovelymusic3549
@lovelymusic3549 Жыл бұрын
Sir when react JS course is coming any idea sir?
@SUMITDAS-tf7jh
@SUMITDAS-tf7jh Жыл бұрын
bhaiya email authentication ka bhi ek video plz bana dena with forget fassword 😊😊
@52akhilkumar16
@52akhilkumar16 4 ай бұрын
OAuth paasport se lga lo
@sheikhumaid9213
@sheikhumaid9213 6 ай бұрын
Is this process production ready?
@fun3.1
@fun3.1 5 ай бұрын
nicely explain
@smrutiranjan18688
@smrutiranjan18688 13 күн бұрын
Bhai please cover about refresh token
@UserNotFound-py5eg
@UserNotFound-py5eg Жыл бұрын
Can you make a proper video on 'How to create a chrome extension' Please
@prigo333
@prigo333 3 ай бұрын
best series
@faizsings
@faizsings 2 ай бұрын
Things are getting quite complicated from now😬😬
@Saucy_Dragon
@Saucy_Dragon Ай бұрын
timestamp: 29:53 Some of us faced this ->Problem: after logging with email and password, I'm being redirected to home page to generate shortUrl but after I enter url even though I was logged in, the req is being redirected back to login page ; Solution: Faced the same issue, check for correct use of : 1.const userUid=req.cookies?.uid; in the middleware ....and also this condition : const user= await getUser(userUid); if(!user){ return res.redirect("/login");}....is causing this issue as when i login for the first time (even using a previously registered id) user turns out to be undefinded......so commenting this condition worked 4 me .....after further inspec there was a missing return statement in getUser service
@xpvishal2031
@xpvishal2031 Ай бұрын
Great 👍
@pallabdandapat1866
@pallabdandapat1866 6 ай бұрын
27:30 --> cookie start
@1212AnurajKharat
@1212AnurajKharat 4 ай бұрын
i have error res.redirect(entry.redirectURL); cannot read properties of null
@facthabhai
@facthabhai 3 ай бұрын
bhai url properties null hoti hi nahi ha
@montyk.151
@montyk.151 4 ай бұрын
What is the difference between checkAuth and restrictto LoggedInUserOnly function?
@MetroExodus999
@MetroExodus999 6 ай бұрын
good job bro
@pabloescobar.exe.
@pabloescobar.exe. Жыл бұрын
Hey piyush, can u make videos on styling web pages using tailwind css Or just css, in UI
@namanjain1684
@namanjain1684 5 ай бұрын
why you don't explain anything like why you are using controller and what is that and other stuffs
@Chhotu668
@Chhotu668 4 ай бұрын
He already explained in his previous videos in the playlist.
@saarza9991
@saarza9991 4 ай бұрын
He explained. Its not his peonlem that you didnt watch properly and just jumped to auth
@BiGryuuu
@BiGryuuu 3 ай бұрын
It's because you should learn nodejs first instead of just Watching tutorials
@devnishmishra
@devnishmishra 2 ай бұрын
MVC framework he is using for development
@Ppap17
@Ppap17 19 күн бұрын
You should have watched from the beginning of the playlist.This is probably the best NodeJS course out there.I regret buying shit courses on udemy when such a gem was already =available on KZbin that too for free.I wish he covered more advanced topics.
@rohitghadage3220
@rohitghadage3220 Жыл бұрын
Sir setting user details in cookies would be done with express-session by default right?
@moonijaz9012
@moonijaz9012 Ай бұрын
i have a confusion that why do we have to make multiple files for routing cant we use single file for this urpose?
@lucifer.morningstar9523
@lucifer.morningstar9523 8 ай бұрын
What if we want to pass the data to frontend like react app instead of .ejs views files How to do it ?
@krishsehgal
@krishsehgal Ай бұрын
user friendly nai hai
@BISWAJITDAS-i4e
@BISWAJITDAS-i4e Ай бұрын
If i can't use getuser method in middleware and call next() method it is login successfully and cant redirect me to login page and it is normally work Please i cant understand why its happen please solve my qustion😢
@crazylive7161
@crazylive7161 2 ай бұрын
Error: Failed to lookup view "sigin" in views directory "G: \url-short \views" at Function.render (g: \url-short ode_modules \express\lib\application.js:597:17) at ServerResponse.render (g: \url-short ode_modules\express\lib esponse.js:1048:7) at g: \url-short outes\staticrouter.js:17:15 at Layer.handle [as handle_request] (g: \url-short ode modules\express\lib outer\layer.js:95:5) at next (g:\url-short ode_modules\express\lib outer oute.js:149:13) at Route dispatch (g: \url-short ode_modules\express\lib outer oute.js:119:3) at Layer-handle [as handle_request] (g:\url-short ode_modules\express\lib outer\layer-js:95:5) at g: \url-short ode_modules\express\lib outer\index.js:284:15 at Function process_params (g:\url-short ode_modules\express\lib outer\index.js:346:12) at next (g: \url-short ode_modules\express\lib outer\index.js: 280:10) Help me guys 😢
@amitkumarlkr
@amitkumarlkr 9 ай бұрын
Done, Done, Done, Done..... 😂😂😂
@Akshay-be3xt
@Akshay-be3xt 7 ай бұрын
can someone please share me code ...i have write but getting error...
@gamingwithasmile268
@gamingwithasmile268 Жыл бұрын
Thanks sir❤
@samad8906
@samad8906 8 ай бұрын
It would have been better if u would use postman or any server client
@SulavGhimireeee
@SulavGhimireeee 11 ай бұрын
Thanks bro
@coolcoder-bh9ic
@coolcoder-bh9ic Жыл бұрын
SIr on deployment why user persistence not there ? means after one time logged in in any device i can generate url in another device also without logged in ?
@dhruvyadav3492
@dhruvyadav3492 4 ай бұрын
sir yeh kafi complicated hogaya hai pls can u make a new video for this , i tried 5 times watching this and still i get lost :(
@dethaliyayashhimatbhai6170
@dethaliyayashhimatbhai6170 4 ай бұрын
Bro he already explained in his previous videos
@fearwayesloot
@fearwayesloot 9 ай бұрын
Bhaiya if middle man proxy use karega he will get our api how we secure
@programming9622
@programming9622 2 ай бұрын
Everything is moving so fast, it's going over my head.
@polymath-403
@polymath-403 Жыл бұрын
Thanks Buddy
@vikashgupta3305
@vikashgupta3305 8 ай бұрын
just WOOWWWWW
@raghavkakkar6647
@raghavkakkar6647 2 ай бұрын
can anyone help me achieve this without mongodb just with ,json file for storing data
@souravkumar961
@souravkumar961 5 ай бұрын
hmm, It seems like you merge two lecture in one video(authentication & cookie). for the first time, cookie implementation is much difficult then authentication.
@bm9code
@bm9code 11 ай бұрын
how setUser is able to get the value stored getUser even after reloding page
@bm9code
@bm9code 11 ай бұрын
solution will be given in next video 38:45
@indrajitnaskar6851
@indrajitnaskar6851 9 ай бұрын
Sir, please first try once before video, instead it's so confusing
@AtulKumar-pi2ky
@AtulKumar-pi2ky Жыл бұрын
Please create a video on google-reCaptcha v2 verification in a registration form to avoid scripting much need and it is not available on any channel where an API is made for that please please make it if possible
@bm9code
@bm9code 11 ай бұрын
zip file of knowledge
@zeta_meow_meow
@zeta_meow_meow Жыл бұрын
github code is not working home.ejs file mai (urls) giving error
@saubhagyalive3061
@saubhagyalive3061 Жыл бұрын
same man !! did u find the solution ? also the redirectURL in index is also giving error to me
@ajiteshmishra0005
@ajiteshmishra0005 7 ай бұрын
Is this called JWT authentication??
@PankajKumarAcharjee
@PankajKumarAcharjee 2 ай бұрын
How to prevent Authentication Bypass via Response Manipulation in nodejs ????
@Netpilation
@Netpilation 2 ай бұрын
jwt authentication ka nam sona hai
@joelosei765
@joelosei765 Жыл бұрын
If you make this video in English it's going to be great,
@saarza9991
@saarza9991 4 ай бұрын
Learn Hindi it's not that hard
@NeerajSharma1
@NeerajSharma1 Жыл бұрын
Object Id create karte time apne ref: 'users' liya hai user ki jagah. Phr bhi ye work kar rha h. Why ?
@sanketmane4026
@sanketmane4026 10 ай бұрын
automatically mongodb me collections vaise hi create hota hai ... for example: const URL = mongoose.model("url", urlSchema); => show collections => urls for example: const User = mongoose.model("user", userSchema); ==> show collections => users model me tum koi aur name dalo aur mongosh me jake show collection karoge to tumhe dikhega
@saarza9991
@saarza9991 4 ай бұрын
​@@sanketmane4026 ha agar User/user ho toh users hota he. Eg: Giraffe/giraffe/giraffes=> giraffes (in mongo) Monkey/monkey/monkeys=>monkeys (in mongo)
@pranjalmaurya3832
@pranjalmaurya3832 9 ай бұрын
After login same login page is rendering similar to that what was happening in your code(30:00), what can be done?
@unknown-vx6ei
@unknown-vx6ei 8 ай бұрын
Check if you have written method and action in your login ejs file 🤔
@myselfashutosh
@myselfashutosh 8 ай бұрын
is your error solved coz im aslo getting same
@theiitjourneytij3377
@theiitjourneytij3377 8 ай бұрын
@@myselfashutosh @unknown-vx6ei @pranjalmaurya3832 maybe in your code you are doing req.cookie.uid do one task do console.log(req) now you will se a last item cookie:"uid=something" but when you use cookieparser it will store your cookie in cookies so when you print the req object you will see two different keys in request object one is cookie and one is cookies:{uid:something} now in cookies you can access req.cookies.uid as in cookies uid is a key name of the inner object but in cookie it is uid="something" which means even if you use req.cookie?.uid then it will always return undefined as it doesnt have uid as key
@saiteja_13
@saiteja_13 5 ай бұрын
same issue, anyone plz explain
@gtbaba123
@gtbaba123 7 ай бұрын
Bro use postman so that u don't have to waste time on creating FE as this video is totally focused on Node JS
@pranaavbv9359
@pranaavbv9359 7 ай бұрын
I mean, he's also giving us an idea about SSR 🤷🏿‍♂️
@saarza9991
@saarza9991 4 ай бұрын
​@@pranaavbv9359 ok nniga
@buland_aavaj1130
@buland_aavaj1130 7 ай бұрын
bhai yrr ejs mat use krna kro na pls real world me kya use h iska
@gamerschoice779
@gamerschoice779 7 ай бұрын
Matlab?
@ibntofajjal
@ibntofajjal Жыл бұрын
Damn Bro!
@adityagupta3870
@adityagupta3870 2 ай бұрын
Bhai, Tu god hain kya?
@im_cpk
@im_cpk 27 күн бұрын
32:00
@indianlion9652
@indianlion9652 Ай бұрын
I didn't like this specific video of yours , most of the time , you were just coding and saying " mai ye kar dunga" but you didn't explain why , and what's the purpose . It's compelling me to just copy and paste whatever you are typing without understanding and I absolutely hate this copy and paste. These topics are crucial and deficult for beginners like me who are just getting started with backend. Please elaborate thingy and be little bit slow and make us beginners understand so that we can implement this knowledge on our own.
@cihadp
@cihadp Жыл бұрын
What language do you speak?
@snehamaurya3659
@snehamaurya3659 10 ай бұрын
Hindi
@SamuelKonanki
@SamuelKonanki 2 ай бұрын
Speak to English everyone understand please Because i don't know Hindi
@sanchitasethi9885
@sanchitasethi9885 11 ай бұрын
My girlfriend 🤣🤣🤣🤣🤣 What an Easter egg hidden here haahahahaha
@NitinVerma_56
@NitinVerma_56 23 сағат бұрын
ghanta kuch samajh nhi aaya
@sameerprajapati9467
@sameerprajapati9467 6 ай бұрын
bhut he ghatiya padhaya hai
@Gulshankumar-yb3qb
@Gulshankumar-yb3qb 5 ай бұрын
Bhai kisse padhna chahiye batao
@kumaranupam8301
@kumaranupam8301 6 ай бұрын
bkl
@FahemEdu
@FahemEdu 10 ай бұрын
if your video is not in english? so why are you writing the title in english??!! take my downvote
@gamerschoice779
@gamerschoice779 7 ай бұрын
Learn Hindi
@sourikray2291
@sourikray2291 7 ай бұрын
well...... there are lots of people like me over India who can understand hindi but can't read it properly so for me it's fine as it is
@saarza9991
@saarza9991 4 ай бұрын
Learn Hindi. It's not that hard. We learned English. Did we complain?
@prakharsinha4145
@prakharsinha4145 Жыл бұрын
req.user._id undefined .... anybody with the isssue ?
@myselfashutosh
@myselfashutosh 8 ай бұрын
yep bro same issue how did you solved
@036kaushik5
@036kaushik5 5 ай бұрын
user User.findOne({}) instead of User.find(), as the first method returns an object the latter returns an array of objects
@Ronakrewar
@Ronakrewar 5 ай бұрын
@@036kaushik5 req.user._id undefined .... anybody with the isssue ? how you resolved it
JWT Authentication in NodeJS
14:30
Piyush Garg
Рет қаралды 120 М.
Implementing Auth from scratch - no dependencies!
19:55
Atila
Рет қаралды 1,8 М.
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,5 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 22 МЛН
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 257 М.
Create a Custom URL Shortener using Node.JS and MongoDB
23:10
Piyush Garg
Рет қаралды 125 М.
What are Cookies in NodeJS?
30:35
Piyush Garg
Рет қаралды 72 М.
Server Side Rendering with EJS and Node.JS
25:24
Piyush Garg
Рет қаралды 94 М.
JWT Authentication Tutorial - Node.js
27:36
Web Dev Simplified
Рет қаралды 1 МЛН
Authorization in NodeJS
19:33
Piyush Garg
Рет қаралды 47 М.
Deploy NodeJS Application on AWS - Amazon Web Services | NodeJS
19:51
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,5 МЛН