TanStack Router: Authenticated Routes (Guards)

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

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

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

    Great work on this. Very few resources are available for the TanStack router from a tutorial perspective & you have done a great job. Thanks.

  • @omkarbhambure2886
    @omkarbhambure2886 4 месяца назад +3

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

  • @presida3927
    @presida3927 10 месяцев назад

    Awesome! please keep continue this series.

  • @markomilardic
    @markomilardic 2 месяца назад

    Thanks, exactly what I was looking for :)

  • @govindpvenu
    @govindpvenu 9 месяцев назад

    This is what exactly i needed.Thank you

  • @armanrozika
    @armanrozika 3 месяца назад +2

    just an opinion from a viewer, it would be better when you change file you change it with the cursor, not the shortcut. I know, you probably used to it, but we as a viewer, at least me, are having hard time focusing because the file is like changing immediately, i have no idea what file you're referring to when you said "this", "add in this". Maybe it's just me tho haha, keep up the good work!

  • @FUNKYSTUFFM8
    @FUNKYSTUFFM8 3 месяца назад

    I dont get my updated context values, so i cant never auth a page.. how can I resolve this ?
    im callinh my isAuth var and its always false in the "context" while trying to auth for redirect.. so I always get redirect to logn.. why :c

  • @mrlectus
    @mrlectus 2 месяца назад

    What of Loading state, where should we put that?

  • @dziaddy
    @dziaddy 4 месяца назад

    I have this problem that I can't use router.invalidate() inside my hook because it's not inside router provider.

  • @EzMC2
    @EzMC2 3 месяца назад

    Sir, you are a hero !

  • @nhatminhhoang1469
    @nhatminhhoang1469 9 месяцев назад +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 9 месяцев назад

      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  9 месяцев назад

      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

  • @juliomac2007
    @juliomac2007 8 месяцев назад

    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.

  • @pofiabel9526
    @pofiabel9526 7 месяцев назад

    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 7 месяцев назад +1

      Resolved.

    • @DevLeonardo
      @DevLeonardo  7 месяцев назад

      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 7 месяцев назад

      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.

  • @cmdeckermusic
    @cmdeckermusic 6 дней назад

    nice

  • @mrlectus
    @mrlectus 3 месяца назад

    Rawu-ter

    • @DevLeonardo
      @DevLeonardo  3 месяца назад

      Gets better from chapter 6 of the playlist :D