Logging Out on multiple tabs

Only solution I’ve got at the moment is using tokenManager.on removed, GitHub - okta/okta-auth-js: The official js wrapper around Okta's auth API.

This event seems to get detected in the other tab. So have to use something like this:

  public tokenRemoved$ = createEffect(
    () =>
      this.tokenRemoved.pipe(
        map(() => {
          this.oktaAuth.signOut({ postLogoutRedirectUri: environment.okta.postLogoutRedirectUri });
        })
      ),
    { dispatch: false }
  );
1 Like