React Login using Access & Refresh Tokens

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

КОМЕНТАРІ • 42

  • @hilariousness4393
    @hilariousness4393 10 місяців тому +3

    I've been trying to solve this for over a week now.
    I had to scroll all the way down to find this gem.
    You're a great teacher man.
    Note: Always scroll down on UA-cam for quality and straight to the point video.

  • @hamedayinde9434
    @hamedayinde9434 2 роки тому +4

    This is the simplest explanation and implementation of refresh token I've seen on UA-cam. Every other ones are just overly vague and complex. Thank you and you earned a new subscriber.

  • @linhpink
    @linhpink 2 роки тому +10

    Hi. I'm working on a real project, and I'm having this situation. I found your approach by accident. Although it has few views, the quality is much better than the videos I found. I want to say thank you very much. Very good and realistic video :3

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

    Finally someone who knows how to make a video that really explains, you are the king bro👑👑👑

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

    this was the clearest explanation of the videos i have watched. thank you so much bro

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

    Best video I have been searching for this all day. Thank you

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

    Wanted to tell you that you made my life easy after this.😌

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

    Thank you so much! All other implementations I found were too vague

  • @patrickudeh5869
    @patrickudeh5869 10 місяців тому

    Good one....
    Please can you share the link for the back end?

  • @bengen12
    @bengen12 19 днів тому

    Hi , thank you for the tuto , 29:02 Can you give us the code for the ' refresh' endpoint in laravel plizzz ?

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

    Thank you very much!! subscribed!!!

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

    This save my life.. lol
    Thank you very much for this video

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

    Thank you very much,
    How to proceed if I store the refresh token in the database ?

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

    I love this. keep it on

  • @KeepItFresh02
    @KeepItFresh02 11 місяців тому

    If you're navigating unauthorized routes for that 30s then want to navigate to the authorized route the access token expires. Then the axios interceptor calls the /refresh route, but the /user endpoint fails again. This does not seem like a good user experience. You have to navigate away from the authorized route then back again to see the UI or the user name. Is this just how the updating with the Authorization header works? its not asynchronous on the frontend. I checked the code on github and its doing the same thing.

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

    מלך 👑

  • @shashankpandey8346
    @shashankpandey8346 9 місяців тому

    I think I missed the backend part.
    can anyone pinpoint it to me?
    I want to see if it is similar to mine.

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

    Is that safe way to save tokens, can attacers(XSS, CSRF) easly attack or it's secure in some way?

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

    thanks a lot!

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

    How are you receiving and storing the cookie on the browser when the server and client are on different domains?
    I have been battling with this for days. I have read more articles, chat GPT, stack overflow etc in 5 days than I have in an entire year. The cookie is sent from the server but the browsers doesn't store it because if from a separate domain so please HOW 😢

    • @KeepItFresh02
      @KeepItFresh02 11 місяців тому

      You may have already solved it but I had the same issue.
      I added these two extra options to the cookie: sameSite: "none", secure: true,

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

    very good bro

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

    the cookie is set on the postman and but isn't being set on the browser while using react . What might be the problem?

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

      Did you solve this problem? I have been having this issue for almost a week* server sends, browser ignores

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

      @@desmondodion9046 sent it as a response

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

      @@desmondodion9046 if it is in production the host name must be same in order to obtain the cookies

    • @abdassalamnaciri-tk4cb
      @abdassalamnaciri-tk4cb 6 місяців тому

      @@desmondodion9046 did you solve that problam please

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

    Хороший ролик, спасибо

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

    hi where you have written server code

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

    haha how i love your accent so cute

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

    Hi,Where can i find the server side code?

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

    With mysql ???

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

    what if i refresh the page, will that token be removed?

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

      The refresh token will not be removed as it is stored as cookie.

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

    Are you king ?

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

    Awesome ++++++++++++++++++++++++++

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

    with django

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

    when I use WithCredentials in axios call I got this error:
    Access to XMLHttpRequest at '****************************' from origin 'localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

    • @hungle-bp5qt
      @hungle-bp5qt Рік тому

      use cors from server man its worked for me