I want to setup my web page hosted by firebase so that.
- User requested a page that needs authentication
- If user is authenticated, serve the page
- If user is not authenticated, redirect to login page, and when login succeeds, redirect to the originally requested page
Searching for solutions, firebase.auth().onAuthStateChanged can be used to check if the user is authenticated, but there is some delay in client side (~ 1 second) which I don't want. Also, I don't know how to redirect to the requested page after successful login.
Can anybody help?
Thanks,
-Minsuk
Aucun commentaire:
Enregistrer un commentaire