Login implementation using JSON Server REST API | React authentication | React JS Full Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 142

  • @rishabhmahajan409
    @rishabhmahajan409 ปีที่แล้ว +3

    Thank you Sir, Learnt a lot from this. I was depressed earlier because that I am not learning much or don't have quite knowledge in React as per 6months exp. But this has just give me sort of confidence. Fluent way of teaching is your USP. Please create more these type of projects in React. Regards ✨🙏

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Sure, Will make more as soon as possible

  • @tommytanti1776
    @tommytanti1776 ปีที่แล้ว +1

    Falling short of a word in your appreciation. Thank you so much for the hard work, you put into this.

  • @francogonzalez6914
    @francogonzalez6914 ปีที่แล้ว

    This is explained very clear content man, thank you!

  • @BukwatiMonette
    @BukwatiMonette ปีที่แล้ว

    Thanks very much sir for this awesome video its very straight forward and easy to understand

  • @rounakbhattacherje3426
    @rounakbhattacherje3426 ปีที่แล้ว

    you are a gem brother, nicely explained. thanks for the concept❤❤👌👌👌👌

  • @gamehacker2011
    @gamehacker2011 ปีที่แล้ว +3

    sessionstorage is wrong method to storage becoz its working on only single tab its worst overall.

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Why you want use the application in 2 tab. If you want like this use local storage or some cookie option....... This video provides some basic idea for real time implementation..... Don't compare with your own requirement

  • @rameshneelamsetti
    @rameshneelamsetti ปีที่แล้ว

    Thank you sir, this video helped me a lot in my project.

  • @johnbeniciotobias2550
    @johnbeniciotobias2550 ปีที่แล้ว

    Kudos to this tutorial ! Very clear and precise , I was able to understand everything compared to the other videos out there,
    More power keep it up Brother !

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Sure, thanks for your valuable comments

  • @samdurai1660
    @samdurai1660 ปีที่แล้ว

    vera lvl bro.keep going bro.just lightly slow bro.👍👍👍

  • @satyasai5172
    @satyasai5172 ปีที่แล้ว

    Hi Sir waiting for next vedio.

  • @jameerbasha5785
    @jameerbasha5785 10 หลายเดือนก่อน

    very wonderfull video thanks

  • @balaraman3953
    @balaraman3953 ปีที่แล้ว +3

    I try to get the data from the json file it will display empty object but in this json my registered data's are available,I gave the same email and password.
    In console it displays error
    1)Failed to load resources: the server responded with a status of 404 Not (url) found.
    2) Get (url) 404 (not filename found)
    Please reply how can I solve this errors.

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว +1

      Capital small letter check may be failure

    • @Kamaraj-gx5ql
      @Kamaraj-gx5ql ปีที่แล้ว

      if (Object.keys(response.data).length === 0)
      if (response.data[0].password === password)

    • @deva.d9178
      @deva.d9178 ปีที่แล้ว

      Me also

    • @deva.d9178
      @deva.d9178 ปีที่แล้ว

      Can you please help me bro?

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Caps small letters check pannunga bro

  • @sawalikorde2722
    @sawalikorde2722 ปีที่แล้ว

    best tutorial thank you so much

  • @NihaPaluvadi
    @NihaPaluvadi หลายเดือนก่อน

    Thank you very much sir

  • @jeyhofficial4858
    @jeyhofficial4858 11 หลายเดือนก่อน

    Is there part 3? I want to ask how to make sure that once I've logged in, I can't go to "/login" anymore

    • @NihiraTechiees
      @NihiraTechiees  11 หลายเดือนก่อน

      Until you not clicked logout it won't go to login page

  • @saideepmeka4308
    @saideepmeka4308 ปีที่แล้ว +1

    Hi sir,
    How to implement session functionality if user logged in when he tries to open url in new tab it should work without asking him to login again

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว +2

      Use localstorage instead of session storage

    • @saideepmeka4308
      @saideepmeka4308 ปีที่แล้ว

      Its works thank you so much

  • @aldotugasumb2366
    @aldotugasumb2366 ปีที่แล้ว

    cool, what about sayinng 'hello +{username}'' how to pass the props, i still confused about this

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Do you want to show hello with username.
      Then create header component globally. The username you will get once logged in that you can store local storage and use it in the header

  • @ivramanainnaidu1275
    @ivramanainnaidu1275 ปีที่แล้ว

    While login even if I am giving the right credentials it's. Getting like please enter valid credentials can you please help me on this?

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      It's case sensitive. So please check any camal case miamatch

  • @sumeetbhikule9338
    @sumeetbhikule9338 ปีที่แล้ว

    Thank you sir , It was a great video to learn react authentication. Just have one question we are storing data into on of the json file but the admin can see the json file and can have access to users sensitive data eg: password. Could you please tell us how we can protect password or any other sensitive information in json file where we store the users registration data?

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Brother json server api is kind of fake api. It's suitable for learning. Real time application we have to use standard api

    • @sumeetbhikule9338
      @sumeetbhikule9338 ปีที่แล้ว +1

      @@NihiraTechiees okay sir thanks for clarification.

  • @Vthoen
    @Vthoen 2 หลายเดือนก่อน

    thx again.

  • @utchihamadara1672
    @utchihamadara1672 ปีที่แล้ว

    im getting error 404, on login GET request server is connected and credential are also correct
    aslo i checked cases and still not working!!!!!

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Debug and find where it's issue created... Could you confirm whether api working?

    • @utchihamadara1672
      @utchihamadara1672 ปีที่แล้ว

      @@NihiraTechiees i used same of your code in this video from github

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Also follow the steps I shown in that video

    • @utchihamadara1672
      @utchihamadara1672 ปีที่แล้ว

      @@NihiraTechiees i already followed all the steps but still not working

  • @ImGufranKarim
    @ImGufranKarim ปีที่แล้ว

    If i don't want toast notification then how to display error message.

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      We can use MaterialUi alert or basic javascript alert

  • @sachinm6068
    @sachinm6068 ปีที่แล้ว

    sir login implementation using method:POST is different from this method?

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว +1

      Method is our decision only. Since this json server api we cannot include any custom logic. That's why I used this get method

    • @sachinm6068
      @sachinm6068 ปีที่แล้ว +1

      @@NihiraTechiees sir make real time ecommerce react project with all functionalities and using material ui

  • @mahathiSannidhi
    @mahathiSannidhi ปีที่แล้ว

    Hii I am getting data from .json file even i entered wrong data what should I do?

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Please share json file and the url you used to my email

  • @NtlantlaSimelela-h7l
    @NtlantlaSimelela-h7l ปีที่แล้ว

    Hello again. Can you please help me in the login form. when i type the credentials that i used to register it won't navigate me to the home page. It keeps saying please enter valid username

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Please check your json files whether the data is there?
      Next it's case sensitive so confirm
      If both please let me know

    • @NtlantlaSimelela-h7l
      @NtlantlaSimelela-h7l ปีที่แล้ว

      @@NihiraTechiees Still it's not working

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Please share json file to email, also share screenshot of value that you provided in username and password

  • @visalofficial1615
    @visalofficial1615 ปีที่แล้ว

    can you tell me about react (js,tsx) why you not use tsx?

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      It's kind of extension . If you too good in typescript you can go with tsx

  • @sambitacharya5649
    @sambitacharya5649 7 วันที่ผ่านมา

    while i am doing the register it says it cannot fetch can yu plz explain

    • @NihiraTechiees
      @NihiraTechiees  14 ชั่วโมงที่ผ่านมา

      Can you confirm your api is running?

    • @sambitacharya5649
      @sambitacharya5649 14 ชั่วโมงที่ผ่านมา

      @NihiraTechiees the query is solved... And it's running perfectly fine brother...
      Thankx.... You explained it very well..

  • @LearnReactWithDeep
    @LearnReactWithDeep ปีที่แล้ว

    Can we call multiple json file and call it in one react app?
    For login, registration and employee

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Same json you can have multiple function

  • @sumathig4439
    @sumathig4439 ปีที่แล้ว

    Hi sir i used single state like const[state,setState]=useState({ name:' ', password: ' '}];
    How to fetch data for this???

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      You are storing object here then you have to set the value as object

    • @sumathig4439
      @sumathig4439 ปีที่แล้ว

      @@NihiraTechiees can you give me one example sir pls ??

  • @facundoperez265
    @facundoperez265 ปีที่แล้ว

    Se puden agregar archivos html a los archivos js, para que me lleve a esos archivos?

  • @PiyushSingh-p8g
    @PiyushSingh-p8g ปีที่แล้ว

    getting error 404, on login GET request server is connected and credential are also correct

  • @appcode-u3t
    @appcode-u3t ปีที่แล้ว

    getting error at 10:14
    404 not found in console . fetch("url/user/(actualusername))

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Can you confirm your api working in postman?

    • @appcode-u3t
      @appcode-u3t ปีที่แล้ว

      yes@@NihiraTechiees

    • @utchihamadara1672
      @utchihamadara1672 ปีที่แล้ว

      did you get any solution?@@appcode-u3t

  • @Kamaraj-gx5ql
    @Kamaraj-gx5ql ปีที่แล้ว

    idha netlify deploy panni katuga bro atha jserserver db.json connect agala

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      JSON-SERVER is technique to create fake API (used only development or study). for deployment you should have proper API

  • @ManJH
    @ManJH ปีที่แล้ว

    Này bạn thân, bạn có thể giúp tôi không?. Tôi không thể chuyển đổi trang khi usenavigation đang trong vòng lặp

  • @satyasai5172
    @satyasai5172 ปีที่แล้ว

    I am practicing in registration class

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Please check source code link in description, please cross check
      Can you confirm did you get any error?

  • @arisbudiharto1997
    @arisbudiharto1997 ปีที่แล้ว

    it will display password inside json object as long as you know the username?

  • @Dev-Phantom
    @Dev-Phantom ปีที่แล้ว

    cool

  • @appaponnu1027
    @appaponnu1027 ปีที่แล้ว

    💖💖💖

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว +1

      🙏👍

    • @appaponnu1027
      @appaponnu1027 ปีที่แล้ว

      @@NihiraTechiees hi bro can u give video for admin give permission for new register user

  • @KARTIKVISHWAKARMA-o9h
    @KARTIKVISHWAKARMA-o9h ปีที่แล้ว

    what changes will be made if we use the real api. Please reply

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Change the api url.otherwise all same

  • @shanavaas5823
    @shanavaas5823 ปีที่แล้ว

    Did U using Redux store for this project can u please tell

  • @satyasai5172
    @satyasai5172 ปีที่แล้ว

    Register data not stored in db.json.
    Can u help sir

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Check the console is any error? Or page reloading

  • @educationkatta6447
    @educationkatta6447 8 หลายเดือนก่อน

    after login it will shoeing login failed not fetched

    • @NihiraTechiees
      @NihiraTechiees  8 หลายเดือนก่อน

      Can you share exception details to my mail

  • @brevathi5692
    @brevathi5692 7 หลายเดือนก่อน

    sir login is showing s error not fetch data

    • @NihiraTechiees
      @NihiraTechiees  7 หลายเดือนก่อน

      Are you using json api?

  • @prateeksahu6868
    @prateeksahu6868 ปีที่แล้ว

    i am getting empty object error plz help me i did same as you did

    • @aahansolanki3548
      @aahansolanki3548 ปีที่แล้ว

      Same problem.

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      The data is case sensitive. So provide exact value. Can you guys confirm the api working fine in swagger (without react)

  • @SuyashGrewal
    @SuyashGrewal ปีที่แล้ว

    Hello sir how to show user name in home page please tell

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว +1

      Define use state variable , set user name from our session variable & finally bind the use state value into html control.
      Check the source code I Included

    • @SuyashGrewal
      @SuyashGrewal ปีที่แล้ว

      @@NihiraTechieesperfect

  • @muruga3603
    @muruga3603 ปีที่แล้ว

  • @sumathig4439
    @sumathig4439 ปีที่แล้ว

    Hi sir im using axios why nit working???

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      I hope it will work. Did you get any error?

    • @sumathig4439
      @sumathig4439 ปีที่แล้ว

      @@NihiraTechiees I used axios.get method insted of fetch but I'm getting not found 404 error sir... Can you give me the code using axios for authentication???

  • @rohithraj7959
    @rohithraj7959 ปีที่แล้ว

    Unable to fetch error sir can you just help me

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Could you confirm your api is running?
      If yes can you share the error got in the console

    • @rohithraj7959
      @rohithraj7959 ปีที่แล้ว

      @@NihiraTechiees yeah but it saying error connection refused

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Look like your service is not running, are you using json server api?

    • @rohithraj7959
      @rohithraj7959 ปีที่แล้ว

      @@NihiraTechiees it is saying network error unable to fetch resource

  • @JaswanthPappala
    @JaswanthPappala ปีที่แล้ว

    we want css styles please provide

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      Please check Source code link in GitHub

    • @JaswanthPappala
      @JaswanthPappala ปีที่แล้ว

      I clearly checked and I create on my own

  • @satyasai5172
    @satyasai5172 ปีที่แล้ว

    But I am getting error msg

  • @satyasai5172
    @satyasai5172 ปีที่แล้ว

    Hi sir

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      yes

    • @satyasai5172
      @satyasai5172 ปีที่แล้ว

      @@NihiraTechiees which topic u will discuss upcomming session

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว

      . Net core, angular and react I am doing Parallel.
      May be my new video in .NET core.
      In react next topic handling jwt token
      Let's see on new year

  • @samdurai1660
    @samdurai1660 ปีที่แล้ว

    reactjs+nodejs+mysql from scratch full stack application want bro?

  • @rajhadvani5675
    @rajhadvani5675 ปีที่แล้ว

    Soured code?

  • @dev.mcisme
    @dev.mcisme ปีที่แล้ว

    Your code is downright crappy in the sense that your API already allows retrieving user data using their username to do local verification, the problem is that it also retrieves the password password, a smart person can, when told that the password is incorrect, check the network activity and that's it.
    Secondly you save the user's session not with a token even if it's not the idea of the century either, but rather hard with the sessionStorage, stupidity since if a person analyses the storage of the session, he can simulate it without having to log in, it can even do it for other users, impersonating them, so think before posting your videos, it can mislead beginners looking for solutions
    Sincerely Mci

    • @NihiraTechiees
      @NihiraTechiees  ปีที่แล้ว +2

      Mr. Mci first you should understand the difference between concept explanation and real time requirement.
      You are acting like security vulnerability tool. But try to understand this is just poc not a final code
      You are talking about token, it's just json server api man, just for learning.
      Regards
      Nihira Techiees