TanStack Router: Authenticated Routes (Guards)

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

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

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

    Awesome! please keep continue this series.

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

    This is what exactly i needed.Thank you

  • @omkarbhambure2886
    @omkarbhambure2886 2 วันที่ผ่านมา

    router.invalidate() is not updated the login data, means on clicking the login sign in button, signout button is not displayed

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

    Thanks! Best information on Tanstack Router out there! I got a little confused in the end about the login.tsx. It was kept importing the old ../utils/auth.ts? I haven't been able to make it work either because of this or because I've trying to apply it to an older JavaScript (no typescript) project.

  • @nhatminhhoang1469
    @nhatminhhoang1469 4 หลายเดือนก่อน +1

    Hi I'm a bit confused in the last part. I created _authenticated.tsx and in the _authenticated FOLDER I have the same 2 files as you. But when I try to call the beforeLoad method on my _authenticated.tsx, it wont apply to the _authenticated folder. And it's also been show in the video

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

      Oh nvm. I tried to clone your repo, updated my dependency of tanstack to be the same as you. It works. Many thanks. Subcribed !

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

      The development of the library is quite active so things might change if you have a different version. Great to hear updating it to the latest worked fine! :D

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

    Hi! exactly what i needed, just that after loging-in, all the routes nested in _authenticated, are now turning up as 404 Not found, but when i take it out of _authenticated, it becomes found : ( please help!

    • @pofiabel9526
      @pofiabel9526 3 หลายเดือนก่อน +1

      Resolved.

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

      Great to hear it's resolved! For context, what was the issue?
      Anyway, you can find the code of the project shown on the video here if you want a reference: github.com/Balastrong/tanstack-router-demo/tree/04-authenticated-routes

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

      Nope ... Turned out not resolved 😭. Now I need that help please. When I login, I realised the is loggedIn state changes to true, but then it does not update immediately in the context, which was resulting the 404, so only when I reload the tab, then the state in the context is updated, which shouldn't be so. Any help is appreciated.