mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Updated browser init to update cache after external auth.
(cherry picked from commit 4a236906eb
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
257850001d
commit
9d98d1a9aa
@@ -32,9 +32,11 @@ import { AppState } from '../../app/app.reducer';
|
|||||||
import { BreadcrumbsService } from '../../app/breadcrumbs/breadcrumbs.service';
|
import { BreadcrumbsService } from '../../app/breadcrumbs/breadcrumbs.service';
|
||||||
import { AuthService } from '../../app/core/auth/auth.service';
|
import { AuthService } from '../../app/core/auth/auth.service';
|
||||||
import { coreSelector } from '../../app/core/core.selectors';
|
import { coreSelector } from '../../app/core/core.selectors';
|
||||||
|
import { RequestService } from '../../app/core/data/request.service';
|
||||||
import { RootDataService } from '../../app/core/data/root-data.service';
|
import { RootDataService } from '../../app/core/data/root-data.service';
|
||||||
import { LocaleService } from '../../app/core/locale/locale.service';
|
import { LocaleService } from '../../app/core/locale/locale.service';
|
||||||
import { HeadTagService } from '../../app/core/metadata/head-tag.service';
|
import { HeadTagService } from '../../app/core/metadata/head-tag.service';
|
||||||
|
import { HALEndpointService } from '../../app/core/shared/hal-endpoint.service';
|
||||||
import { CorrelationIdService } from '../../app/correlation-id/correlation-id.service';
|
import { CorrelationIdService } from '../../app/correlation-id/correlation-id.service';
|
||||||
import { InitService } from '../../app/init.service';
|
import { InitService } from '../../app/init.service';
|
||||||
import { KlaroService } from '../../app/shared/cookies/klaro.service';
|
import { KlaroService } from '../../app/shared/cookies/klaro.service';
|
||||||
@@ -81,6 +83,9 @@ export class BrowserInitService extends InitService {
|
|||||||
protected menuService: MenuService,
|
protected menuService: MenuService,
|
||||||
private rootDataService: RootDataService,
|
private rootDataService: RootDataService,
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
|
private requestService: RequestService,
|
||||||
|
private halService: HALEndpointService,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
store,
|
store,
|
||||||
@@ -169,17 +174,15 @@ export class BrowserInitService extends InitService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* During an external authentication flow invalidate the SSR transferState
|
* During an external authentication flow invalidate the
|
||||||
* data in the cache. This allows the app to fetch fresh content.
|
* data in the cache. This allows the app to fetch fresh content.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private externalAuthCheck() {
|
private externalAuthCheck() {
|
||||||
|
|
||||||
this.sub = this.authService.isExternalAuthentication().pipe(
|
this.sub = this.authService.isExternalAuthentication().pipe(
|
||||||
filter((externalAuth: boolean) => externalAuth),
|
filter((externalAuth: boolean) => externalAuth),
|
||||||
).subscribe(() => {
|
).subscribe(() => {
|
||||||
// Clear the transferState data.
|
this.requestService.setStaleByHrefSubstring(this.halService.getRootHref());
|
||||||
this.rootDataService.invalidateRootCache();
|
|
||||||
this.authService.setExternalAuthStatus(false);
|
this.authService.setExternalAuthStatus(false);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user