From d5398d9e32e8928e1734aadbb7e015f0f3193580 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 7 Jul 2022 11:38:33 -0400 Subject: [PATCH] LP1840773 Auth logout broadcast honors auth domain Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/core/auth.service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 -- 2.11.0