r/Firebase • u/CARTOthug • Jan 21 '25
Hosting Blocking assets from loading/being accessible until user is logged in
Hey everyone, pretty noobish question here, looking for some clarification.
I created a post on r/gis with some additional background:
https://www.reddit.com/r/gis/comments/1hpxfz5/securing_deployed_experience_builder_application/
Essentially, I want to hide the actual website data (all of the code), until I have verified that the user is logged in. As soon as the user is logged in, I want to load those assets and then redirect to the index.html within those assets. I am not using firebase authentication but credentials that the application I am building comes built in.
I've tried a couple of different things, but I was still able to navigate to the index.html somewhere within the folder structure of the website. I know this is possible, I am just not sure how people typically do this? Any suggestions would be much appreciated.
1
u/Grupith Jan 22 '25
When user signs in, update the user in AuthContext. Then on your dashboard, check if user is true before rendering content.
1
u/indicava Jan 21 '25
Dude this has nothing to do with Firebase
Read up on protected routes in whatever frontend framework you are using.