Ibtissam Ibtissama
Ibtissam Ibtissama

Reputation: 179

logout from google and facebook using angular

after login to Facebook and Google using this

I am unable to signout for Google and Facebook with this code.

this.authService.signOut();
sessionStorage.clear();

Can anyone please help me!

Upvotes: 3

Views: 3298

Answers (2)

Prashanth Bhonagiri
Prashanth Bhonagiri

Reputation: 41

import { SocialUser , SocialAuthService } from 'angularx-social-login';
...
socialUser: SocialUser;
constructor(private socialAuthService: SocialAuthService) {}
...
signup(){
...
  this.socialUser = userData;
...
}
logout() {
  ... 
  if(this.socialUser !== null) {
     this.socialAuthService.signOut();
  }
}

This worked for me to Logout from Google using angularx-social-login npm module link

Upvotes: 0

Naman
Naman

Reputation: 11

Please use this this.authService.signOut(true);

Upvotes: 1

Related Questions