🎯 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.
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.
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
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?
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
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.
@@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
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
@@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
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
@@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
@@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
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 😢
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 UA-cam that too for free.I wish he covered more advanced topics.
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😢
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 ?
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
big problem with this playlist is continuing with the same example code from previous session ..it causes problems if you are stuck with simple things like those packages like nanoid and shortid
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
hmm, It seems like you merge two lecture in one video(authentication & cookie). for the first time, cookie implementation is much difficult then authentication.
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.
🎯 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.
hey! do you faced the same problem at 29:00 i.e. not being able to generate short urls after login?
Bhai video se jyada heavy Tera comment hai ☠️
@whyDude123 🤣
@@pranjalmaurya3832 is it solved now coz I am facing the same problem
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.
This is the best NodeJS series ever made.
agreed 💯
Thanks a lot for availing this series for free, we know it takes hell amount of your time.
Thanks mate.
Best Nodejs series out there and I am not even kidding how good he teaches
yes man @piyush Garg is a god sent man
But don't think that's a full series on Node.js; he covered it yesterday in his live stream.
@@mujibulhaquetanim Complete nhi hai kya ye??
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
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?
Same issue
What do you mean by "it doesn't load"?? Can you explain in detail...
@@shubham0546 some issus, can you fixed this, if you done, help me please
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
The Best Teacher 👍👍👍👍👍👍
Itna achha to Paid Course me bhi content nhi milta
when i saw this playlist for first time i was frustrated but now i am able to grasp the concepts
Bohot acha sa samjatha ho.
Make more projects in Nodejs/Expressjs.
Bohot Shukriya
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.
Thank you for keeping the comment, it helped me
@@ombandurkar7950 happy to help 🙂
@@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
7:10
16:20 login
20:33 cookie
31:00
Really amazing explanation, easy to learn because of you.
banda cool hay. Zabardast analogies use ki bhai. Happy to find a teacher like you. Wandering why your channel is so underrated.
Sir please cover JWT Authentication and Local Storage in depth.
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...
Great Video Thanks Sir
Most welcome
I am watching this series in sep 2024 but it is the one of the best series on node js
Wow i cleared my all concepts 😎
Great 🚀
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
Badhiya tha acha hua maine mongo node sb padha h warna ghanta smjh aaata lekin passport use karne pe easy ho jata h
After login same login page is rendering similar to that what was happening in your code(30:00), what can be done?
Check if you have written method and action in your login ejs file 🤔
is your error solved coz im aslo getting same
@@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
same issue, anyone plz explain
First time I see Gravity Falls and Adventure Time crossover
What does it mean?
@@Developer-s4z The parking lot example he showed in the beginning used Adventure Time and Gravity Falls Characters.
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
Noted
@@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
@@shivanshsrivastava5561 hii same problem bro can you please help me
@@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
Thankyou so much for the wonderful playlist.
Great video bhaiya !! Please make more videos asap
why cant i use the restrictToLoggedInUserOnly instead of the checkAuth?
You have been doing great job sir
i have error res.redirect(entry.redirectURL); cannot read properties of null
bhai url properties null hoti hi nahi ha
Alert : these videos are knowledge heavy so please keep focused 🤯🤯🤯🤯😎😎😎
Authentication best tuterial ,,love form bd❤❤
what a masterpiece playlist😃
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 😢
I clone your code ,but the urls that user visited is not working, both users data is showing, please some one help me
Best Series. 👩🏻💻👩🏻💻
Enjoyed the entire video! Lot of learning! Thank you :)
27:30 --> cookie start
Thank you sir ❤
why you don't explain anything like why you are using controller and what is that and other stuffs
He already explained in his previous videos in the playlist.
He explained. Its not his peonlem that you didnt watch properly and just jumped to auth
It's because you should learn nodejs first instead of just Watching tutorials
MVC framework he is using for development
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 UA-cam that too for free.I wish he covered more advanced topics.
Is this process production ready?
What if we want to pass the data to frontend like react app instead of .ejs views files
How to do it ?
i have a confusion that why do we have to make multiple files for routing cant we use single file for this urpose?
bhaiya email authentication ka bhi ek video plz bana dena with forget fassword 😊😊
OAuth paasport se lga lo
how setUser is able to get the value stored getUser even after reloding page
solution will be given in next video 38:45
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😢
What is the difference between checkAuth and restrictto LoggedInUserOnly function?
Great 👍
Sir when react JS course is coming any idea sir?
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 ?
Bhai please cover about refresh token
can we include this in our resume projects??
can someone please share me code ...i have write but getting error...
github code is not working
home.ejs file mai (urls) giving error
same man !!
did u find the solution ?
also the redirectURL in index is also giving error to me
Object Id create karte time apne ref: 'users' liya hai user ki jagah. Phr bhi ye work kar rha h. Why ?
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
@@sanketmane4026 ha agar User/user ho toh users hota he.
Eg: Giraffe/giraffe/giraffes=> giraffes (in mongo)
Monkey/monkey/monkeys=>monkeys (in mongo)
can anyone help me achieve this without mongodb just with ,json file for storing data
nicely explain
Sir setting user details in cookies would be done with express-session by default right?
Well explained... Where I can get the code for reference
good job bro
best series
big problem with this playlist is continuing with the same example code from previous session ..it causes problems if you are stuck with simple things like those packages like nanoid and shortid
felt like watching a interesting cinema .
Thanks sir❤
Bhaiya if middle man proxy use karega he will get our api how we secure
Hey piyush, can u make videos on styling web pages using tailwind css Or just css, in UI
Osm series💥
But can you add the complete authentication like....
Sign up
Otp verify
Email verify
Login
......etc
Sure
Thanks Buddy
just WOOWWWWW
Thanks bro
How to prevent Authentication Bypass via Response Manipulation in nodejs ????
jwt authentication ka nam sona hai
Is this called JWT authentication??
Done, Done, Done, Done..... 😂😂😂
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
Things are getting quite complicated from now😬😬
Can you make a proper video on 'How to create a chrome extension'
Please
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 :(
What language do you speak?
Hindi
user friendly nai hai
32:00
It would have been better if u would use postman or any server client
hmm, It seems like you merge two lecture in one video(authentication & cookie). for the first time, cookie implementation is much difficult then authentication.
Damn Bro!
bhai yrr ejs mat use krna kro na pls real world me kya use h iska
Matlab?
Bro he already explained in his previous videos
My girlfriend 🤣🤣🤣🤣🤣
What an Easter egg hidden here haahahahaha
If you make this video in English it's going to be great,
Learn Hindi it's not that hard
Bro use postman so that u don't have to waste time on creating FE as this video is totally focused on Node JS
I mean, he's also giving us an idea about SSR 🤷🏿♂️
@@pranaavbv9359 ok nniga
Everything is moving so fast, it's going over my head.
Sir, please first try once before video, instead it's so confusing
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.
Bhai, Tu god hain kya?
zip file of knowledge
Speak to English everyone understand please Because i don't know Hindi
req.user._id undefined .... anybody with the isssue ?
yep bro same issue how did you solved
user User.findOne({}) instead of User.find(), as the first method returns an object the latter returns an array of objects
@@036kaushik5 req.user._id undefined .... anybody with the isssue ? how you resolved it
bhut he ghatiya padhaya hai
Bhai kisse padhna chahiye batao
ghanta kuch samajh nhi aaya
bkl
if your video is not in english? so why are you writing the title in english??!! take my downvote
Learn Hindi
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
Learn Hindi. It's not that hard. We learned English. Did we complain?