I am using angularx-social-login. I can sign in with Google in the loginComponent:
this.authService.signIn(GoogleLoginProvider.PROVIDER_ID).then(
data => {
this.socialUser = data;
})
I have this structure:
app
auth
loginComponent
shared
menuComponent(here is the link logout)
When I try to logout from menuComponent appears an error: You are not logged In.
logout(): void {
this.authSocialService.signOut()
.then( res => console.log( res ) )
.catch( err => console.log(err) )
}
My question is how can I logout from menuComponent of the session opened in the loginComponent?
Here is recreated the error in Stackblitz.
To issues a logout it's simple just call the signOut() from the service in any of your components, but make sure to import SocialAuthService first. Here's an example.