You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing Google login, the this.authService.authState.subscribe() callback in the Login.component.ts is subscribed. However, upon user logout and returning to the login page, the authState callback is triggered again, creating the impression of logging in anew. Despite attempting to unsubscribe from the observable, the issue persists.
// In Login.component.ts// Subscribe to authState callbackconstauthSubscription=this.authService.authState.subscribe((user)=>{this.user=user;this.loggedIn=(user!=null);});// ...// Upon logout or component destruction, unsubscribe to prevent unwanted triggersngOnDestroy(){authSubscription.unsubscribe();}
Despite the effort to unsubscribe using authSubscription.unsubscribe(), the callback is still being invoked.
The text was updated successfully, but these errors were encountered:
Tweniee
changed the title
Not Able to logout
Persistent authState Callback Trigger on Logout/Return to Login Page.
Dec 5, 2023
When implementing Google login, the
this.authService.authState.subscribe()
callback in theLogin.component.ts
is subscribed. However, upon user logout and returning to the login page, theauthState
callback is triggered again, creating the impression of logging in anew. Despite attempting to unsubscribe from the observable, the issue persists.Despite the effort to unsubscribe using
authSubscription.unsubscribe()
, the callback is still being invoked.The text was updated successfully, but these errors were encountered: