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
* the cache so the app is rehydrated with fresh data.
* During the external authentication flow invalidates the SSR transferState
* data in the cache. This allows the app to fetch fresh content.
* @private
*/
private externalAuthCheck() {
this.authenticationReady$().pipe(
switchMap(() => this.authService.isExternalAuthentication().pipe(
this.authService.isExternalAuthentication().pipe(
filter((externalAuth: boolean) => externalAuth)
))
).subscribe(() => {
this.authService.setExternalAuthStatus(false);
// Clear the transferState data.
this.rootDatatService.invalidateRootCache();
this.authService.setExternalAuthStatus(false);
}
);