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
wise-white•13mo ago
can you also show the
getAllUrls
function?ratty-blushOP•13mo ago
Yes
ratty-blushOP•13mo ago
GitHub
GitHub - starks97/urlShortener: frontend of url shortener
frontend of url shortener. Contribute to starks97/urlShortener development by creating an account on GitHub.
ratty-blushOP•13mo ago
GitHub
GitHub - starks97/urlShortener: frontend of url shortener
frontend of url shortener. Contribute to starks97/urlShortener development by creating an account on GitHub.
ratty-blushOP•13mo ago
If you know something let me know I just want to finish this project
wise-white•13mo ago
The repo you gave only contains a readme file
ratty-blushOP•13mo ago
Change to master
Change to master branch
wise-white•13mo ago
oh, ok
ratty-blushOP•13mo 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
wise-white•13mo 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
ratty-blushOP•13mo ago
Thanks but I don’t know
Should catch before
like-gold•13mo ago
the git repo does not contain the
_authed
route
please strip this example down so it is complete but minimalratty-blushOP•13mo 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