I’ve got an app that redirects users depending if they are logged in or not. It’s displaying some odd behaviour, which i’mt rying to get to the bottom of. I don’t understand the logic of this code - i am an angular newbie so it might be simple. why are there + signs in the paths, and why does it look like both times it goes to the same place. I’ve tried googling, but i’m not getting anywhere. if anyone can point me in the right direction please
firebase.auth().onAuthStateChanged((user) => {
console.log(user)
if (!user) {
return;
}
let providerInfo = JSON.stringify(firebase.auth().currentUser.providerData[0].providerId);
if (Login.emailVerification && providerInfo == '"password"') {
if (user['emailVerified']) {
//Goto Home Page.
this.zone.run(() => {
console.log("asdfsdf")
this.router.navigate(['/' + Login.homePage + '/' + Login.homePage + '/timeline']);
console.log("Go to Tabs Page")
});
}
else {
this.router.navigate(['/' + Login.verificationPage]);
}
}
else {
//Goto Home Page.
this.zone.run(() => {
this.router.navigate(['/' + Login.homePage + '/' + Login.homePage + '/timeline']);
console.log("Go to Tabs Page")
});
//Since we're using a TabsPage an NgZone is required.
}
});
1 post - 1 participant