Ayush Saurav

Ayush Saurav

  • 1.5k
  • 112
  • 1.3k

Angular2,4,6, Firebase Social Login

Oct 21 2018 5:10 AM
I am doing login into my webapp with Firebase social login (Google Login). I am using CanActivate for login page redirection but CanActivate is not waiting for the authentication to be completed, it's returning the value without getting actual result. Same thing is happening in LogInComponent, when I am clicking on Login with Gmail button, the full method behind it, is getting excuted without waiting for full login happening. How to resolve this issue? Below is my login methid in login component.
 
login(){
console.log('In login method');
this.authService.doGoogleLogin();
this.authGuard.authG = true;
this.router.navigate(['home']);
}

Answers (1)