export const Route = createFileRoute('/_authenticated')({
component: Authenticated,
beforeLoad: async () => {
await auth.authStateReady();
if (!auth.currentUser) throw redirect({ to: '/' });
},
});
I managed to solve it, the problem was that I lost the user's state when reloading the page, thus falling into the condition and being redirected to the login page, I just had to wait for the loading state with authStateReady.