DEV Community

Discussion on: Firebase React Authentication Tutorial For Beginners - Private Route With Hooks

Collapse
 
calacianu profile image
Cristi Calacianu

Hi Maksim,
I implemented something similar, I checked the private route component and it's the same. But I have a problem, after I refresh the app I'm redirected to the sign-in page. I think the problem is that when firebase is checking for onAuthStateChanged it takes a bit of time. Have you encountered something similar?

Thank you!

Collapse
 
dowi profile image
Dovi Winberger

I have the same problem, did you manage to find a solution?

Collapse
 
satansdeer profile image
Maksim Ivanov

You can get the authentication status, and if it's unknown - render some loader instead of the application component tree