Merge remote-tracking branch 'remotes/origin/master' into shibboleth

# Conflicts:
#	src/app/core/auth/auth.service.ts
#	src/app/core/auth/models/auth-status.model.ts
#	src/app/core/auth/models/normalized-auth-status.model.ts
#	src/app/core/auth/server-auth.service.ts
#	src/app/core/core.module.ts
#	src/app/shared/shared.module.ts
This commit is contained in:
Giuseppe Digilio
2020-02-25 17:31:07 +01:00
446 changed files with 8024 additions and 6657 deletions

View File

@@ -8,6 +8,8 @@ import { distinctUntilChanged, filter, map, startWith, switchMap, take, withLate
import { RouterReducerState } from '@ngrx/router-store';
import { select, Store } from '@ngrx/store';
import { CookieAttributes } from 'js-cookie';
import { followLink } from '../../shared/utils/follow-link-config.model';
import { LinkService } from '../cache/builders/link.service';
import { EPerson } from '../eperson/models/eperson.model';
import { AuthRequestService } from './auth-request.service';
@@ -55,7 +57,7 @@ export class AuthService {
protected routeService: RouteService,
protected storage: CookieService,
protected store: Store<AppState>,
protected rdbService: RemoteDataBuildService
protected linkService: LinkService
) {
this.store.pipe(
select(isAuthenticated),
@@ -154,7 +156,7 @@ export class AuthService {
headers = headers.append('Authorization', `Bearer ${token.accessToken}`);
options.headers = headers;
return this.authRequestService.getRequest('status', options).pipe(
map((status) => this.rdbService.build(status)),
map((status) => this.linkService.resolveLinks(status, followLink<AuthStatus>('eperson'))),
switchMap((status: AuthStatus) => {
if (status.authenticated) {
return status.eperson.pipe(map((eperson) => eperson.payload));