I am looking to implement mandatory login, into my website. The problem i am having is that, i cant find a way to do so. Lets say i create a SignIn page like so
var uiConfig = {
signInSuccessUrl: '<url-to-redirect-to-on-success>',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.TwitterAuthProvider.PROVIDER_ID,
firebase.auth.GithubAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID,
firebase.auth.PhoneAuthProvider.PROVIDER_ID
],
tosUrl: '<your-tos-url>'
};
var ui = new firebaseui.auth.AuthUI(firebase.auth());
ui.start('#firebaseui-auth-container', uiConfig);
</script>
On a page called www.example.com/SignIn
If i go to www.example.com/Index
I could totally bypass all the signin.
I figured that something like this
if ( FirebaseUser.getCurrentUser () != null ) {
redirect to sign in page }
How ?
Thanks
Aucun commentaire:
Enregistrer un commentaire