Complete User Authentication in React JS , Node, Express, MongoDB with JWT - MERN Stack Tutorial #10

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 355

  • @asharma741
    @asharma741 3 роки тому +15

    So many times I write the same message. This channel is really awesome with respect to beginner-level perspective. Authentication in roughly 1 hour is insane. There was no area in the video where I felt that it's going over my head. Best Teaching :)

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      Awesome dude, Glad I could help 🔥

  • @codegamer5163
    @codegamer5163 2 роки тому +3

    That was really good, but be carful guys not to copy any code from the repo in the description cause its different from the code in the video

  • @quasarkid4256
    @quasarkid4256 3 роки тому +3

    This helped me a lot. Great job. Looking forward to the rest of the series

  • @user-cv7ml2rc7n
    @user-cv7ml2rc7n 8 місяців тому +4

    if anyone is getting problem in register frontend page
    change Form.File to Form.Control and inside it change type = "image/png" to type = "file"

    • @harshyadav5253
      @harshyadav5253 7 місяців тому

      Thanks i was struggling with this for soo long

    • @kunaldeshmukh9983
      @kunaldeshmukh9983 2 місяці тому

      Hi have u completed the whole project ​@@harshyadav5253

  • @sabirullah6297
    @sabirullah6297 3 роки тому +1

    A very authentic, simple and genuine way of explaining

  • @mehtabmultani3194
    @mehtabmultani3194 3 роки тому +2

    Hey Brother!
    Instead of uploading the pics to the cloud, you can use the "multer" package for uploading the files to the server. so we don't need third-party cloud services. what do you think? any correction to this comment? it's worth seeing your words on this.

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +6

      Yes, I am aware of multer. But heroku doesn't allow you to host images with multer. For this you will have to host on aws, azure etc, which will be bit advance for a beginner. That's why I decided to cloudinary service.

    • @mehtabmultani3194
      @mehtabmultani3194 3 роки тому

      @@RoadsideCoder ohh okay got it.

  • @muhammadkarrar4261
    @muhammadkarrar4261 2 роки тому +2

    Hi,
    i can not find the api base url in cloudinary dashboard can u please help me

  • @kapilc
    @kapilc 2 роки тому

    We can add setLoading(false) in finally block
    well, enjoying your video.. One of the best Tutor and Series. Thanks bro

  • @mehakmattoo7485
    @mehakmattoo7485 Рік тому

    if anyone is facing difficulties even when their code with matching, just close all your apps, and try again after some time. Works wonders sometimes
    Also, always use the same email and password for testing which is hashed

  • @zyt2712
    @zyt2712 2 роки тому

    this guy's opening speech is funny and important, keep up bro.

  • @boyden11
    @boyden11 2 роки тому +1

    absolutley insanely good course! if anyone is stuck because they are using react-router-dom v 6 and getting a problem with history, you can use useNavigate to work around. let me know if useful to post the code!

    • @reanna792
      @reanna792 2 роки тому

      @boyden11 Could you please post the code with the changes incorporated for react-router-dom v 6 especially for that navigate part? It will be really beneficial for many.

  • @rupeshgupta369
    @rupeshgupta369 2 роки тому

    I have been following your videos from video 1 onwards can you explain me the folder structure why you have Screens and Components separately I'm confused Screens folder also container Components which are part of the same so why different folder?. And if possible please explain whole folder/ file structure

  • @paragcoimbatore6024
    @paragcoimbatore6024 2 роки тому +1

    Took 3 days to complete and finally completed

  • @narenkumar8436
    @narenkumar8436 2 роки тому +2

    I am @43:12 in the post method I am not specifying the config i.e. the 3rd parameter in axios.post but I am getting the response from the backend without errors. Is config not mandatory?
    try{
    setLoading(true);

    const { data } = await axios.post('/users/login',{
    email,
    password,
    });
    console.log(data);
    }
    catch(error){
    console.error(error);
    }

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      What response are you getting?

    • @narenkumar8436
      @narenkumar8436 2 роки тому

      @@RoadsideCoder Getting the data as an output in the console

  • @IvinAustan
    @IvinAustan Рік тому

    I learnt a lot from you piyush. Such a great way of teaching. Thanks a lot for this video.

  • @NoudvD63
    @NoudvD63 2 роки тому +1

    Crystal clear, thank you so much!

  • @paolodefeo1484
    @paolodefeo1484 2 роки тому

    I haven't get how the database users collection has been created... I've never seen a noSQL database so I'm confused. By seeing the mongodb panel I understood there are no table but collections, looks cool!, but how do we create them?

  • @chlnsgang4384
    @chlnsgang4384 2 роки тому +1

    I don't know how the documents are inserted :) I am not getting clarity on this We are inserting the user id password email etc... without the collection.insert command how the values are inserted as documents in a collection called users. I haven't watched full the video yet. Everything is working fine up to now (23.00) . just needed clarity on this.

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому +1

      Its because we are using mongoose for it

  • @atdc1779
    @atdc1779 3 роки тому +2

    U are officially my teacher😘.

  • @meetkothari9734
    @meetkothari9734 2 роки тому

    Best, no need to explain how good this man is...helped a lot

  • @alejandrozuniga1126
    @alejandrozuniga1126 2 роки тому

    Hi! Amazing videos! You are great! I have a question, I have to build an application to render questions and answers, as a kind of Quiz App. Do you have any videos including authentication and something similar?

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому +1

      You can combine this video and my quiz app video, I believe that will help

  • @asharma741
    @asharma741 3 роки тому

    I can understand passing jwt in sign in route.
    Hi bro what is the idea of passing jwt in sign-up response ?

  • @mehdi72753
    @mehdi72753 2 роки тому +2

    Can anyone help me with this problem please...
    I get this Error in the log = "Cannot read properties of undefined (reading 'push')" When i use the useEffect for etting the item from LocalStorage and pushing to /mynotes and i checked many times Nothing is wrong with my code.

    • @ayushuniyal9822
      @ayushuniyal9822 Рік тому

      facing same problem, please reply if you solve the problem

    • @godgaming4071
      @godgaming4071 7 місяців тому

      import { useNavigate } from "react-router-dom";
      const navigate = useNavigate();
      useEffect(() => {
      const userInfo = localStorage.getItem("userInfo");
      if (userInfo) {
      navigate("/my-notes");
      }
      }, [history]);

  • @bibhasash7371
    @bibhasash7371 2 роки тому

    But localStorage is vulnerabke though it is obvious that everything on the internet is. But we should use res.cookie to store the jwt token inside cookie and when we are requesting through some other routes where it is mandatory to authenticate the user there we can check if req.cookies is defined or not and one more thing we need to pass one header that is credential: 'include' for fetch and for axios withCredentials: true.. Httponly cookies re not accessible by the frontend js there it decreases the chances of scripting attack like xss

  • @ahmadmuraish1144
    @ahmadmuraish1144 3 роки тому

    You honestly deserve more subs.. this tutorial was amazing!

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Thanks so much ❤️ Please do share with others who need it!

    • @ahmadmuraish1144
      @ahmadmuraish1144 3 роки тому

      @@RoadsideCoder ِAlready did :)
      I forced 16 students to watch your video :D its a bit out of our league but we used what we could understand, we are coding in a slightly different way " not the class way " sorry i am still learning and I am not good at expressing code into words :P

    • @ahmadmuraish1144
      @ahmadmuraish1144 3 роки тому

      @@RoadsideCoder You should try making a login video the same way, with token and stuff, I will be looking forward to it.

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Awesome 😁🔥 I'll surely make a better version of this with more features.

  • @raymondmichael4987
    @raymondmichael4987 3 роки тому

    Well just subed today; hoping to grasp this mern full stack.
    Greetings from Tanzania 🇹🇿

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Awesome, glad to have you as my subscriber 🙏

  • @claudiovitordantas2348
    @claudiovitordantas2348 3 роки тому

    Jesus, that's the video i needed. Thanks man!

  • @satyamshukla1418
    @satyamshukla1418 2 роки тому

    here , we are creating jwt token both at the register as well as the login time but my doubt is do we need to compare the token generated at the login time with the token generated at the register time ....to identify the user....if that is supposed to happen where is it happening.
    because what i am seeing here is that while loging in we are just checking the email and email exists in database the we are using compare of mongoose to verify the user......hence I am confused what's the use of JWT token here .....i think we are simply generating them both the time.....if i am saying anything incorrect please correct me and help me to resolve my doubt.

  • @reverbmusic8444
    @reverbmusic8444 6 місяців тому +1

    what is the use of JWT which we created here ?

  • @anamikaahmed4887
    @anamikaahmed4887 2 роки тому

    Great tutorial! However, the heroku link shows an "Application Error".

  • @bryanzikhayi1061
    @bryanzikhayi1061 2 роки тому +1

    where did you get your "JWT_SECRET"

  • @TheMostRetardedFrog
    @TheMostRetardedFrog 2 роки тому +1

    Hi! At 27:53, my response keeps telling me "Invalid email or password". The matchPassword is not working for some reason. When I console.log the matchPassword logic in both the userController and UserModel, both show the result false - which means the password is not matching? But the data entered matches the data from my database exactly.
    And when I console.log(user) in userController I get the correct user information showing up, so something in the matchPassword logic is not working.
    I checked my syntax many times, it matches exactly yours. Do you have any advice on what is going on here?
    Based on my own google searches, I think it might be a pending promise issue that requires a .then, but I am not sure how to incorporate this

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Maybe await is missing somewhere? Try to check

    • @TheMostRetardedFrog
      @TheMostRetardedFrog 2 роки тому

      @@RoadsideCoder Thanks for the quick response! Double-checked and I have my await everywhere. something in the Controller for the bcrypt.compare function is not working. I can see both passwords are being read correctly, but the comparison keeps returning false
      I just did a bit more debugging and noticed in the bcrypt.compare function, my enteredPassword is being returned as a string, but my this.password(from the database) is being returned as undefined. Not sure how to fix this.

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Send me the screenshot oninstagram @RoadsideCoder

  • @eelguneezmemmedov1671
    @eelguneezmemmedov1671 2 роки тому

    I have a question
    I managed to display email and password after registering(In order to make facility to yuser doesnt write the same again)
    email was displayed correctly but i have issue with password . i cant decrypt it .It shows with encrypt version(hash version)
    How should i decrypt it with react ?

  • @DeepakKumar-oz5ky
    @DeepakKumar-oz5ky 5 місяців тому

    Great explanation

  • @osakpolorihensekhien294
    @osakpolorihensekhien294 2 роки тому +1

    Please i have an issue...
    At the login page while trying to connect it with the database it was given me a "Not Found" error in the browser console but it worked well in postman. I have look through the codes and gone through the video but I don't know where I missed it.
    Thanks for the Video, It's really been awesome

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Which line gives not found error?

    • @tomasburian6550
      @tomasburian6550 2 роки тому

      @@RoadsideCoder It's not a specific line, it's the function the sends the data from the form inputs to the MongoDB database through submitHandler. It sends the data to /api/users or /api/users/login, but it returns not found (404) error, both in RegisterScreen and LoginScreen.

    • @hoyino8580
      @hoyino8580 2 роки тому

      @@tomasburian6550 same

    • @animeshchaturvedi943
      @animeshchaturvedi943 2 роки тому

      @@tomasburian6550 can you tell how yu resolved it

    • @tomasburian6550
      @tomasburian6550 2 роки тому

      @@animeshchaturvedi943 I don't remember, sorry. But it sounds like it's a problem with setting a proxy in that package.json (on the client's side). Try putting "proxy":"localhost:5000" in there, it should help. If it's a problem with CORS, then put the below code into the server.js (or whatever file that you run the server from):
      var corsOptions = {
      origin: 'localhost:3000',
      optionsSuccessStatus: 200, // For legacy browser support
      methods: "GET, PUT, POST"
      }
      app.use(cors(corsOptions));

  • @arpitmishra9936
    @arpitmishra9936 2 роки тому +1

    Please add role management in this, it will be very helpfull

  • @sinaukode
    @sinaukode 3 роки тому

    49:18 you are adding history as a props on the LoginScreen function, can you tell me what is it??, because on your App.js file you don't parse anything there

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      History helps us to explicitly push our app to any other route. When we wrap our app in BrowserRouter this is sent automatically.
      Eg -
      history.push('/home')

    • @sinaukode
      @sinaukode 3 роки тому

      @@RoadsideCoder thanks

  • @aaronfernandes4688
    @aaronfernandes4688 2 роки тому

    I want to some data to a particular user. Can I achieve that functionality by following this video ?

  • @zyt2712
    @zyt2712 2 роки тому

    this session is a bit too fast pace for me, was i'm a very basic beginner,
    Is it possible you may break down this session into several small ones, like "Module": why need to create Module, "Controllers": whats the purpose of Controllers...
    thanks

    • @sandyGamer97
      @sandyGamer97 2 роки тому +1

      It is the part of MVC architecture , where code is broken into different folders or structures like schema is usually placed in model folder , in controller part you can have functions which execute get put post delete etc and in routes , you can have different api end points like this .

  • @nawazishali274
    @nawazishali274 3 роки тому

    Sir should we send data from login screen in frontend to backend where we have created our login api by fetch method rather than getting data from backend with axios..."""??

  • @lawrenceughonu4954
    @lawrenceughonu4954 2 роки тому +1

    Please I am facing a challenge updating the user on mongodb. I keep get the error ValidationError: User validation failed: name: Path `name` is required. Please can anyone help me with this

  • @thilakmani1287
    @thilakmani1287 2 роки тому

    underrated video in context of mern authentication, keep posting dude

  • @realAgitated
    @realAgitated Рік тому

    my users are being registered with all the right information and encryption that goes into mongodb, however I am not getting a console confirmation, I was wondering where this clog should be?

  • @garbjorn1757
    @garbjorn1757 2 роки тому

    49:50
    userinfo is not defined because { you declared it inside this function }, [ and cant be reach by here]

  • @saikrishnabhandarwar1713
    @saikrishnabhandarwar1713 3 роки тому

    Great tutorial brother... Cleared lot of stuff for me.... Keep it up...

  • @yatingupta8233
    @yatingupta8233 3 роки тому

    Bro I just want to ask for one thing, please mention the docs or from wherever you add those functions, procedures or methods because it helps us to look into those and understand them better. Otherwise it is just copy pasting I hope u will look into that....

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      U mean the react code or the backend code in express js?

    • @yatingupta8233
      @yatingupta8233 3 роки тому

      @@RoadsideCoder yeah backend first of all like auth or like comapre pass I know they are available on docs but sometimes it becomes hard to find and as for react code the connection part too. But still brother Kudos for the hardwork.....

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Yeah man, I try to go through docs only.. And just try these things for yourself, these are the only way to do this.. I just explain it once for you all to grasp clearly

    • @yatingupta8233
      @yatingupta8233 3 роки тому

      @@RoadsideCoder ya i know dude i am not saying to explain or anything just mention them either in description or in the video

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      Got it 🤘

  • @newborn7850
    @newborn7850 2 роки тому

    Q1 How to deploy on free cloud / host for testing. Q2. How can admin upload files so that users can access them . Rest your teaching is valuable Thanku

  • @nawazishali274
    @nawazishali274 Рік тому

    Please make a video on jwt authentication with interceptors and user role base protected routing

  • @user_at180
    @user_at180 2 роки тому

    Using many useState's causes many rerenders and not efficient way, we can use useRef or object instead

  • @kiranraj7960
    @kiranraj7960 Рік тому

    hey bro I need help when using the postman link to add {name,email,password,pic} on res.json its not returning me the value that I've entered
    on the output its showing {}

  • @krishnaprasad_k
    @krishnaprasad_k 3 роки тому +1

    Thanks brother you saved❤️

  • @shafaqshaikh798
    @shafaqshaikh798 3 роки тому +3

    you are teaching good , but we cannot called it "from scratch" because the beginner cannot understand this fast paced learning , this tutorial is good for those who have an intermediate or atleast basic understanding of these technologies. otherwise the tutorial is really helpful.

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      I have mentioned it in the beginning that this video is a part of a series 😄. Have you watched previous videos?

    • @shafaqshaikh798
      @shafaqshaikh798 3 роки тому +1

      Yeah I am talking about the whole series , your videos are awesome 👌🏻 no doubt , just saying that it’s not for absolute beginners.

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      Umm.. Ok, Thanks Shafaq, will try to improve.

    • @pawntozy
      @pawntozy 2 роки тому

      I don't know, I'm a node beginner and this was really helpful getting started. Then again different strokes for different folks. Thank you Roadside Coder!

  • @jayantverma4639
    @jayantverma4639 2 роки тому +2

    TypeError: Cannot read properties of undefined (reading 'data')
    at submitHandler if anyone else is getting this error while registering a new user 57 : 30

  • @shyamkumbhar3170
    @shyamkumbhar3170 3 роки тому

    thank you sir . very helpful video and very good explanation with shortcut tips.

  • @HayGrouve
    @HayGrouve 3 роки тому +1

    I did not get where the token auth was, everything else was a blast!

  • @parveshahuja7801
    @parveshahuja7801 2 роки тому

    Do u provide online classes?

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Yes, please contact me on instagram @RoadsideCoder

  • @kshitrajsrivastava1742
    @kshitrajsrivastava1742 3 роки тому +2

    I am getting proxy error on submitting the login form can anyone help me with this error

  • @kushagrasingh7025
    @kushagrasingh7025 2 роки тому +5

    For anyone facing error using history with react-router-dom v6 use the code snippet below. Make sure to make proper imports of useNavigate.
    const [email, setEmail] = useState("");
    const [password, setPassword] = useState("");
    const [error, setError] = useState(false);
    const [loading, setLoading] = useState(false);
    let navigate = useNavigate();
    useEffect(() => {
    const userInfo = localStorage.getItem("userInfo");
    if (userInfo) {
    navigate("/mynotes");
    }
    }, []);

    • @saurabhshakya5367
      @saurabhshakya5367 2 роки тому +3

      Thanks a lot. if we remove the dependency array '[]' then we won't have to refresh, navigate will immediately take us to mynotes

    • @deepaksarkar5783
      @deepaksarkar5783 2 роки тому

      Or i guess you could simply use :
      window.location.href = “/mynotes”

  • @nodedev1532
    @nodedev1532 3 роки тому

    @
    RoadsideCoder hello brother , we set the jwt in localstorage but how do we verify the token and then redirect to notes page ? i mean we set the token and then what do we do with it after providing email and password in login we see that in localstorage jwt is set but how to we verify it ? also you commented the useffect where you parse data from localstortage and the put a check on if(userInfo) but then u commented it also you put a check on the userinfo u didnt verified the jwt.. so how does this work? imk confused plz help thanks

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      The verification is done in the backend, we will add the 'protect' Middleware, it's in the further videos

    • @nodedev1532
      @nodedev1532 3 роки тому

      @@RoadsideCoder thanks for replying , so this tutorial on jwt is yet not complete right ?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      It is completed. Checkout the playlist, link in description

    • @nodedev1532
      @nodedev1532 3 роки тому

      @@RoadsideCoder thanks a lot brother , your work is really appreciated :)

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Thanks man

  • @TheNamesJT
    @TheNamesJT 3 роки тому

    So for the homepage on my project I want to retrieve data from all users however the way the back end is setup i'm not able too because of this token(jwt) it only gets generated when a user signs in but I want to display data on the homepage without any signing in or registering basically want to get all user data without a token.....ugh. Like how you can still see youtube videos without being signed in but you can still see youtube videos from users. So on my homepage, I want to display certain userData from all users without the need of me having a dam token.

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Yeah that's completely possible, just don't put the protect middleware in that particular route in backend

    • @TheNamesJT
      @TheNamesJT 3 роки тому

      ​@@RoadsideCoder Please make a video on this because if I removed the middle ware then the login authentication would break. I also decided to just delete my whole back end and start from scratch. Do you have a similar tutorial but without integrating jwt?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      No man, it will not break. Contact me on instagram @RoadsideCoder I'll tell u

  • @jaskaranminhas2330
    @jaskaranminhas2330 3 роки тому

    Hello Sir,
    at 05:35 min in the video the res.json( ) was not retuning anything in POSTMAN, so I try this code :-
    const registerUser = async (req, res) => {
    try {
    const { name, email, password, pic } = req.body;
    await res.send({
    name,
    email,
    });
    } catch (e) {
    console.log(e);
    }
    };
    Now got response.
    just sharing my Experience.

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      Oh cool!

    • @jaskaranminhas2330
      @jaskaranminhas2330 3 роки тому

      @@RoadsideCoder be my MENTOR please..

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Sure! Contact me on instagram @RoadsideCoder

    • @naveenbhati5177
      @naveenbhati5177 3 роки тому

      were you also getting the error " connect ECONNREFUSED 127.0.0.1:5000" ?

    • @dineshsubba8150
      @dineshsubba8150 Рік тому

      still not getting response in postman what could be wrong

  • @anasthasyaaverina8082
    @anasthasyaaverina8082 3 роки тому

    Hi, can you show me how to modify the code if I want to save the picture to the cloud ONLY when clicking submit?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Yes, in that case you can call the post function after clicking submit.. And not after onChange.
      Reach out to me on instagram @RoadsideCoder if you have any further doubts

    • @anasthasyaaverina8082
      @anasthasyaaverina8082 3 роки тому

      @@RoadsideCoder Okay! I've already contact you at IG, would you mind checking your DM? Thanks so much :D

  • @SachinYadav-nl8ko
    @SachinYadav-nl8ko Рік тому

    Can we upload Pic to our db using "multer" form our backend code?

  • @fizawaheed9685
    @fizawaheed9685 2 роки тому

    secretOrPrivateKey must have a value. i am facing this error as i followed the series exactly same. what can i do.

  • @animeshchaturvedi943
    @animeshchaturvedi943 2 роки тому +1

    I am getting the error 404 not found while I am trying to send the data by post request from my front end. It works fine while I do with post man, but when I send from frontend , It shows this error

    • @kalynndier6524
      @kalynndier6524 2 роки тому

      did you ever get this fixed? I am having the same trouble now and can't get it fixed.

    • @kiranaryal709
      @kiranaryal709 2 роки тому

      @@kalynndier6524 same with me anyone one of you fixed pls help

  • @kiranraj7960
    @kiranraj7960 2 роки тому +2

    Hi bro am getting this error
    Uncaught TypeError: history.push is not a function

  • @TatyMasika
    @TatyMasika Рік тому

    following the instructions on video #10 user authentication, I am not getting the data from backend as he did
    Any Idea please, no way to move further

  • @rangabharath4253
    @rangabharath4253 3 роки тому +1

    Hi bro. You can use thunder client for vs code. Similar to postman in vs code. :-)

  • @Rammohan-nx2ts
    @Rammohan-nx2ts 3 роки тому

    Fantastic stuff sir ❤️

  • @k.a.rayhan7017
    @k.a.rayhan7017 2 роки тому

    How to use protected routes using node JS authentication ?? Please help !!

  • @miketracz2695
    @miketracz2695 Рік тому

    Is there a way to reset a password for a user? By editing the password in MongoDB? I am not sure because the password is encrypted. Any help would be appreciated.

  • @aryangupta7290
    @aryangupta7290 2 роки тому +1

    At 43.16 on the login page getting this error, please help.
    Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'data')

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Try to console.log data to check what's in it

    • @aryangupta7290
      @aryangupta7290 2 роки тому

      @@RoadsideCoder Did the same, getting this error, texted you with complete error and code in Instagram. Please check sir.
      Thank you for ur contents and ur quick response.

    • @akeemjokosenumi7946
      @akeemjokosenumi7946 2 роки тому

      @@aryangupta7290 hi did you get this error fixed and if you did could you submit your fix

    • @jayantverma4639
      @jayantverma4639 2 роки тому

      if your issue already got resolved, please let me if how you have tackled it

  • @AliHassan-nt3iz
    @AliHassan-nt3iz 2 роки тому

    Hey bro, i need some help, im unable to find fetch url of cloudinary as my dashboard is bit different as compare to you

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Try to google, it or check in cloudinary docs. Its there

  • @ruchithachodavarapu815
    @ruchithachodavarapu815 Рік тому

    const statusCode = res.statusCode === 200 ? 500 : res.statusCode;
    can someone pls explain this line im not getting y r we changing the status code to 500 when it is 200(success)
    if it is a success(200) y does it even trigger the errorHandler()

  • @shivamsrivastava487
    @shivamsrivastava487 3 роки тому

    bro in your alert component how does the error msg are showing
    "invalid email or password"
    from where this is showing?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Try to compare your code with mine. Link in description.

  • @larbibenyakhou
    @larbibenyakhou Рік тому

    thank you 🥰

  • @kiranraj7960
    @kiranraj7960 2 роки тому +1

    Can anyone help me with the login page to mynotes page redirect issue

  • @52nevil36
    @52nevil36 2 роки тому

    great video

  • @dariusdarius9506
    @dariusdarius9506 2 роки тому

    sir in this same code how i will check the user if its already exist in our database with same email and we have to show the error I am stuck in this for hours can any one help

  • @yashchitroda2257
    @yashchitroda2257 2 роки тому +1

    Form.File is not working properly. How to resolve it?

  • @karanroy-vr1wn
    @karanroy-vr1wn 2 роки тому

    what if we don't give expiry to token then how long it survive

  • @manoharchimata19
    @manoharchimata19 2 роки тому

    If I click on login after submitting the credentials it doesn't navigate but I refresh the page it navigates how to overcome this problem..

  • @madhurendra-nath-tiwari
    @madhurendra-nath-tiwari 2 роки тому

    Form.File is not supporing and after using it nothing is showing on page

  • @rangabharath4253
    @rangabharath4253 3 роки тому +1

    awesome bro :-)

  • @mr.shoaibmalik2488
    @mr.shoaibmalik2488 3 роки тому

    Awesome sir❤❤❤

  • @ajinkyahatwar1334
    @ajinkyahatwar1334 3 роки тому

    while generating token, it is showing error like secrete key must have a value... what to do?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Did you compare with my code? Link in Description.

  • @anurodhdubey1041
    @anurodhdubey1041 2 роки тому

    can you please tell what i have to write in jwt secret value in env?

  • @kunalprashantpatil6332
    @kunalprashantpatil6332 2 роки тому

    Can I skip this line in usermodel.js file?
    if (!this.isModified("password")) {
    next();
    }

  • @raymondmichael4987
    @raymondmichael4987 3 роки тому

    I'm back again; Why do I get history undefined? from where did you pass in history as a props to LoginScreen?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      const history = useHistory()
      Its imported from react router dom

    • @raymondmichael4987
      @raymondmichael4987 3 роки тому

      @@RoadsideCoder, yes but I didn't see you where you did pass it in, I only saw when you destructured it as loginScreen props(didn't see const history = useHistory() part)

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Oh 🤔, weird

    • @raymondmichael4987
      @raymondmichael4987 3 роки тому

      @@RoadsideCoder, yeah I know, and upon visiting your repo, I saw same issue in several place.
      But I just created const history out of useHistory hook just so I can procees with your wonderful tutorial series
      Thanks for your quick reply though, its 2100hr(9pm) I don't know what's the time at your geolocation

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      Thanks man. Its 11:30 PM here

  • @bossbaby2670
    @bossbaby2670 2 роки тому +1

    any one having the "history.push is not a function error?

  • @martinmo5687
    @martinmo5687 3 роки тому

    Hello sir.. I need ur help.... I can't create a MainScreen tag inside the LoginScreen.js file.... Please help me to solve this...

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Hey , What;s the exact issue you're facing? and wwhats the error?

  • @amoln3655
    @amoln3655 Рік тому +1

    Failed to load resource: the server responded with a status of 400 (Bad Request)
    i am getting this when i am checking login functionality plz help

    • @amitjalui
      @amitjalui Рік тому +1

      even i am facing the same

    • @amitjalui
      @amitjalui Рік тому +2

      "Content-Type" - T will be capital

    • @amoln3655
      @amoln3655 Рік тому

      @@amitjalui i do that it showing nothing not even bad request

    • @amoln3655
      @amoln3655 Рік тому

      @@amitjalui this solved your problem ??

    • @amitjalui
      @amitjalui Рік тому +1

      @@amoln3655 Yes, cause in video he typed "T" in small letter. (I think he forgot to mention this during video editing)

  • @jinamnasfi1141
    @jinamnasfi1141 3 роки тому

    hi sir i want to thank you for this video . i faced a problem when i want to try the login (in the minute 44.50) i found an error in the console
    [HTTP/1.1 404 Not Found 0ms]

  • @kiranraj7960
    @kiranraj7960 2 роки тому

    Hi @roadsidecoder bro am getting this error
    {"message":"Not Found - /","stack":"Error: Not Found - /
    at notFound (C:\\Users\\user\\Desktop\\mt1\\backend\\middlewares\\errorMiddleware.js:2:17)
    at Layer.handle [as handle_request]
    When I tried opening the backend port it is not working

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      I think you're trying to hit a route that doesn't exist

    • @kiranraj7960
      @kiranraj7960 2 роки тому

      @@RoadsideCoder But on the postman tool its working fine

    • @kiranraj7960
      @kiranraj7960 2 роки тому

      on the login screen its showing this error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'data')

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому +1

      Can u check the HTTP Method? If it's GET or POST

    • @kiranraj7960
      @kiranraj7960 2 роки тому

      @@RoadsideCoder YEs Now its Working :) Thanks

  • @amit6721
    @amit6721 Рік тому

    17:30 TypeError: Cannot read properties of undefined (reading 'findOne') anyone know the how to resolve it?

  • @52nevil36
    @52nevil36 2 роки тому

    nice video

  • @dhruvdeora9781
    @dhruvdeora9781 2 роки тому +1

    Bro please help me. First of all bcryptjs is not crypting my password. And second its showing matchpassword is not a function

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Try to compare your code with mine, link in description

    • @dhruvdeora9781
      @dhruvdeora9781 2 роки тому

      @@RoadsideCoder I did Bro But there is nothing different

    • @dhruvdeora9781
      @dhruvdeora9781 2 роки тому

      @@RoadsideCoder i will try improvising the cord tho so lets see

  • @kiranraj7960
    @kiranraj7960 2 роки тому

    hai bro am still facing the issue I tried adding the history("/mynotes") code right under the setLoading(false); and its redirecting me to the mynotes page but its not under the useEffect can you please help me?

    • @manoharchimata19
      @manoharchimata19 2 роки тому +1

      Bro me also getting same error if you can find please inform to me

    • @RoadsideCoder
      @RoadsideCoder  2 роки тому

      Can u compare your code with mine?

    • @manoharchimata19
      @manoharchimata19 2 роки тому

      @@RoadsideCoderyeah but it didn't work

    • @kiranraj7960
      @kiranraj7960 2 роки тому

      @@manoharchimata19 Hi bro I checked with piyush bro(@RoadsideCoder) he said we need to install this particular version of react-router-dom
      npm I react-router-dom@5.2.0 as in the new version of react-router-dom v6 the useHistory has been replaced with useNavigate and so we can't use history.push()

    • @prachitisirga
      @prachitisirga 5 місяців тому

      @@RoadsideCoder instead of history.push use navigate from usenavigate hook.

  • @naveenbhati5177
    @naveenbhati5177 3 роки тому

    I'm getting error in postman "connect ECONNREFUSED 127.0.0.1:5000" and if I comment out mongodb(); function in server.js then it works... why...can you please help me out?

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      Try to compare your code with mine. Link in Description.

    • @naveenbhati5177
      @naveenbhati5177 3 роки тому

      @@RoadsideCoder compared brother...my code is same as your code....after connecting to mongodb i am getting "MongoDB connected" but then this problem occurs :-(

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому

      Contact me on instagram @RoadsideCoder

    • @naveenbhati5177
      @naveenbhati5177 3 роки тому +1

      @@RoadsideCoder sure, thank you for responding fast as f*** -:)

    • @RaviShankar-hu6yw
      @RaviShankar-hu6yw Рік тому

      bro just make a new cluster and change the server and then connect this cluster to your .env

  • @geeksoftechworld8882
    @geeksoftechworld8882 3 роки тому

    Great video brother. Can you also implement Google authentication in this

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      I will teach google auth in upcoming tutorials

    • @geeksoftechworld8882
      @geeksoftechworld8882 3 роки тому

      @@RoadsideCoder thanks bro. If you implement Google login here it will be the best video available for authentication and crud in youtube 😀

    • @geeksoftechworld8882
      @geeksoftechworld8882 3 роки тому

      I tried it myself but getting little confused😔

    • @RoadsideCoder
      @RoadsideCoder  3 роки тому +1

      @@geeksoftechworld8882 we wil create a crypto currency tracker, in that we will implement

    • @geeksoftechworld8882
      @geeksoftechworld8882 3 роки тому +1

      @@RoadsideCoder waiting for it bro👏