im getting some troubles with firebase authentication and google provider. Im trying to signin with google provider (this works fine) but then i want to redirect to my homepage
I read the comments so this is now a 2 part question:
1) For Google Auth, the signInWithRedirect() and signInWithPopUp() methods don't work in cordova/ionic apps yet.
You'll need to use the Google native plugin to get the login credentials and then you can pass them to firebase.auth.signInWithCredentials()
2) About the bug sending you to the HomePage:
There's a weird bug in Ionic's navCtrl that isn't pushing the page after it returns with the user in:
firebase.auth().onAuthStateChanged((user) => {
if (!user) {
this.nav.setRoot(Home);
} else {
this.nav.setRoot(Menu);
}
});
I got that working by simply declaring rootPage: any = Menu; and then doing this instead:
firebase.auth().onAuthStateChanged((user) => {
if (!user) {
this.nav.setRoot(Home);
}
});