Problems with beforeLoad() and load()
Hello guys, im making my app with react, vite and tanstackrouter, and ive been doing great since i faced this problem from couple weeks whiout a progress and wondering if someone can give me a hand. The problem its releated with how the app its handling the auth of the user, im trying to protect the routes with beforeLoad() but its been ignoring by load() and its rendering first the data. Im trying all the ways to fix it but nothing fix it. If somebody can give me an advice that will be helpful thanks





13 Replies
like-gold•16mo ago
can you also show the
getAllUrls function?stormy-goldOP•16mo ago
Yes
stormy-goldOP•16mo ago
GitHub
GitHub - starks97/urlShortener: frontend of url shortener
frontend of url shortener. Contribute to starks97/urlShortener development by creating an account on GitHub.
stormy-goldOP•16mo ago
GitHub
GitHub - starks97/urlShortener: frontend of url shortener
frontend of url shortener. Contribute to starks97/urlShortener development by creating an account on GitHub.
stormy-goldOP•16mo ago
If you know something let me know I just want to finish this project
like-gold•16mo ago
The repo you gave only contains a readme file
stormy-goldOP•16mo ago
Change to master
Change to master branch
like-gold•16mo ago
oh, ok
stormy-goldOP•16mo ago
But yeah I’m having that issue, I can not finish with my app, I’m trying to do my best but I’ve been stuck
It supposed to work first the before load
like-gold•16mo ago
have you tried console logging the data from /session_status?
Also, I am sorry but I cannot really look at the entire code right now, if nobody else answers I will try to reply tomorrow
stormy-goldOP•16mo ago
Thanks but I don’t know
Should catch before
extended-yellow•16mo ago
the git repo does not contain the
_authed route
please strip this example down so it is complete but minimalstormy-goldOP•16mo ago
Yes I didn’t upload that to my git, but it’s the same still loading first loader and then beforeload still ignored
i fixed
if somebody wants to know how i made it, well it wasnt easy to realize, but at the same time easy