79523285

Date: 2025-03-20 14:49:58
Score: 1
Natty:
Report link
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.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Vinicius R. Pilati