From: Bill Erickson Date: Thu, 7 Jul 2022 15:38:33 +0000 (-0400) Subject: LP1840773 Auth logout broadcast honors auth domain X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=16696aa301ca97eb1e73d9317cfbd34fae1d234a;p=working%2FEvergreen.git LP1840773 Auth logout broadcast honors auth domain Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/core/auth.service.ts b/Open-ILS/src/eg2/src/app/core/auth.service.ts index f549cba4a6..1a9310c21d 100644 --- a/Open-ILS/src/eg2/src/app/core/auth.service.ts +++ b/Open-ILS/src/eg2/src/app/core/auth.service.ts @@ -224,10 +224,12 @@ export class AuthService { `received eg.auth broadcast ${JSON.stringify(e.data)}`); if (e.data.action === 'logout') { - // Logout will be handled by the originating tab. - // We just need to clear tab-local memory. - this.cleanup(); - this.net.authExpired$.emit({viaExternal: true}); + if (!e.data.domain || e.data.domain === this.authDomain) { + // Logout will be handled by the originating tab. + // We just need to clear tab-local memory. + this.cleanup(); + this.net.authExpired$.emit({viaExternal: true}); + } } }; } @@ -325,7 +327,7 @@ export class AuthService { // This should only be invoked by one tab. broadcastLogout(): void { console.debug('Notifying tabs of imminent auth token removal'); - this.authChannel.postMessage({action : 'logout'}); + this.authChannel.postMessage({action : 'logout', domain: this.authDomain}); } // Remove/reset session data