I'm trying to make a part of my website that is restricted to only that of people who are logged in.
Currently, I am able to check their login status with:
firebase.auth().onAuthStateChanged(function (user)
But I was wondering whether this was the correct option to use, as it displays the restricted page for one or two seconds before the user gets redirected to the homepage.
Are there any alternatives that provide a better solution?
Thanks in advance.