How to create Private Routes and Authentication with React Router V6

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

Комментарии • 28

  • @youaskforit
    @youaskforit Год назад +2

    That was a new take on routing logic that I've seen so far. You earned your 71st sub. Looking forward to your channel's growth.

  • @frankie_goestohollywood
    @frankie_goestohollywood Год назад +1

    I am so glad I found your channel. Great content!!! 🤗🤓👌

  • @dimitrispapakos4020
    @dimitrispapakos4020 9 месяцев назад +1

    Great code , can I please ask how do we redirect to access denied page if we type in /Account if user is not logged in

    • @СергейК-б6н
      @СергейК-б6н 2 месяца назад

      I'm from Russia, but I hope you understand me :D
      I suggest trying to work with conditional rendering,
      For example userisAuth ? : navite('./login')

    • @kodieCode
      @kodieCode  Месяц назад

      You could manually do that but I would add a default root

    • @kodieCode
      @kodieCode  Месяц назад

      Good suggestion but only if there is no public page option

  • @kanakaraju7655
    @kanakaraju7655 Год назад +1

    Love it thanks

  • @krsna1912
    @krsna1912 Год назад +1

    So when user hit refresh button State will get reset and user will be logged out again … have to log in again and again… not a good user experience

    • @kodieCode
      @kodieCode  Год назад

      This was just a basic example. The new video I'm working on goes into storing information in the local storage and how to both check if a user is logged in and time out their session.

    • @kodieCode
      @kodieCode  Год назад

      The new video will mean they stay logged in even on a browser refresh.

  • @borakececi8472
    @borakececi8472 Год назад +1

    Thanks A lot !

    • @kodieCode
      @kodieCode  Год назад

      No problem, thanks for the comment

  • @benarcher372
    @benarcher372 Год назад

    Thanks for an interesting walk-through! However, old eyes so I can't read the code. Could you provide a github link or similar? Keep up the good work!

    • @kodieCode
      @kodieCode  Год назад

      Thanks for the comment Ben. I'm planning to re-record this tutorial soon and will both increase the font size and include a download link for the code.

    • @kodieCode
      @kodieCode  Год назад

      A new version of this video is now on the channel with larger text but also a download link for the code.

  • @DebanjanChakraborty-tp4kt
    @DebanjanChakraborty-tp4kt Год назад +1

    Sorry but I can't see the code...its too small. Please make it zoom so that it can be watchable

    • @kodieCode
      @kodieCode  Год назад

      Thanks for the feedback. A new version with larger text and a link to the code on github is on its way

    • @kodieCode
      @kodieCode  Год назад +1

      A new version of this video is now on the channel with larger text but also a download link for the code.

  • @sebastiankoziel8055
    @sebastiankoziel8055 Год назад

    Nice video! It would be nice to have a starting code somewhere.

    • @kodieCode
      @kodieCode  Год назад +1

      Thanks for the feedback. I'll be sure to start posting links to the code

    • @kodieCode
      @kodieCode  Год назад

      A new version of this video is now on the channel with larger text but also a download link for the code.

  • @kevs3654
    @kevs3654 Год назад +1

    too small sir, i cant read it

    • @kodieCode
      @kodieCode  Год назад

      Thanks for the feedback. There will be a new updated version of this video soon together with a code download link

    • @kodieCode
      @kodieCode  Год назад +1

      A new version of this video is now on the channel with larger text but also a download link for the code.

    • @kevs3654
      @kevs3654 Год назад +1

      @@kodieCode Thanks sir, New subscriber here!