intermediate commit

This commit is contained in:
lotte
2018-08-29 15:12:01 +02:00
parent 2cbe6a6d91
commit 777facf5cd
91 changed files with 1150 additions and 964 deletions

View File

@@ -1,3 +1,5 @@
import {first, map} from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
@@ -32,14 +34,14 @@ export class ServerAuthService extends AuthService {
headers = headers.append('X-Forwarded-For', clientIp);
options.headers = headers;
return this.authRequestService.getRequest('status', options)
.map((status: AuthStatus) => {
return this.authRequestService.getRequest('status', options).pipe(
map((status: AuthStatus) => {
if (status.authenticated) {
return status.eperson[0];
} else {
throw(new Error('Not authenticated'));
}
});
}));
}
/**
@@ -53,8 +55,8 @@ export class ServerAuthService extends AuthService {
* Redirect to the route navigated before the login
*/
public redirectToPreviousUrl() {
this.getRedirectUrl()
.first()
this.getRedirectUrl().pipe(
first())
.subscribe((redirectUrl) => {
if (isNotEmpty(redirectUrl)) {
// override the route reuse strategy