Skip to content

Commit 4c2a7a1

Browse files
committed
updated auth-cookie check
1 parent 290a899 commit 4c2a7a1

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/modules/app/browser-init.service.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,18 @@ export class BrowserInitService extends InitService {
139139
}
140140

141141
/**
142-
* When authenticated during the external authentication flow invalidate
143-
* the cache so the app is rehydrated with fresh data.
142+
* During the external authentication flow invalidates the SSR transferState
143+
* data in the cache. This allows the app to fetch fresh content.
144144
* @private
145145
*/
146146
private externalAuthCheck() {
147147

148-
this.authenticationReady$().pipe(
149-
switchMap(() => this.authService.isExternalAuthentication().pipe(
150-
filter((externalAuth: boolean) => externalAuth)
151-
))
148+
this.authService.isExternalAuthentication().pipe(
149+
filter((externalAuth: boolean) => externalAuth)
152150
).subscribe(() => {
153-
this.authService.setExternalAuthStatus(false);
151+
// Clear the transferState data.
154152
this.rootDatatService.invalidateRootCache();
153+
this.authService.setExternalAuthStatus(false);
155154
}
156155
);
157156

0 commit comments

Comments
 (0)