updated auth-cookie check

This commit is contained in:
Michael Spalti
2023-04-06 07:33:46 -07:00
committed by Michael W Spalti
parent 290a89909e
commit 4c2a7a10c7

View File

@@ -139,19 +139,18 @@ export class BrowserInitService extends InitService {
} }
/** /**
* When authenticated during the external authentication flow invalidate * During the external authentication flow invalidates the SSR transferState
* the cache so the app is rehydrated with fresh data. * data in the cache. This allows the app to fetch fresh content.
* @private * @private
*/ */
private externalAuthCheck() { private externalAuthCheck() {
this.authenticationReady$().pipe( this.authService.isExternalAuthentication().pipe(
switchMap(() => this.authService.isExternalAuthentication().pipe( filter((externalAuth: boolean) => externalAuth)
filter((externalAuth: boolean) => externalAuth)
))
).subscribe(() => { ).subscribe(() => {
this.authService.setExternalAuthStatus(false); // Clear the transferState data.
this.rootDatatService.invalidateRootCache(); this.rootDatatService.invalidateRootCache();
this.authService.setExternalAuthStatus(false);
} }
); );