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

# Conflicts:
#	src/app/core/data/base-response-parsing.service.ts
#	src/app/core/data/request.service.ts
This commit is contained in:
Giuseppe Digilio
2019-04-25 13:09:58 +02:00
17 changed files with 177 additions and 97 deletions

View File

@@ -130,14 +130,10 @@ 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)),
switchMap((status: AuthStatus) => {
if (status.authenticated) {
// TODO this should be cleaned up, AuthStatus could be parsed by the RemoteDataService as a whole...
// Review when https://jira.duraspace.org/browse/DS-4006 is fixed
// See https://github.com/DSpace/dspace-angular/issues/292
const person$ = this.rdbService.buildSingle<EPerson>(status.eperson.toString());
return person$.pipe(map((eperson) => eperson.payload));
return status.eperson.pipe(map((eperson) => eperson.payload));
} else {
throw(new Error('Not authenticated'));
}
@@ -226,7 +222,6 @@ export class AuthService {
throw(new Error('auth.errors.invalid-user'));
}
}))
}
/**