Added refresh token functionality

This commit is contained in:
Giuseppe Digilio
2018-02-26 15:41:07 +01:00
parent 2637f1c28e
commit 696b8b73f5
22 changed files with 301 additions and 114 deletions

View File

@@ -8,7 +8,7 @@ import { Observable } from 'rxjs/Observable';
import { isNotEmpty } from '../../shared/empty.util';
import { AuthGetRequest, AuthPostRequest, PostRequest, RestRequest } from '../data/request.models';
import { ResponseCacheEntry } from '../cache/response-cache.reducer';
import { AuthSuccessResponse, ErrorResponse, RestResponse } from '../cache/response-cache.models';
import { AuthStatusResponse, ErrorResponse, RestResponse } from '../cache/response-cache.models';
import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service';
@Injectable()
@@ -37,8 +37,8 @@ export class AuthRequestService extends HALEndpointService {
errorResponse.flatMap((response: ErrorResponse) =>
Observable.throw(new Error(response.errorMessage))),
successResponse
.filter((response: AuthSuccessResponse) => isNotEmpty(response))
.map((response: AuthSuccessResponse) => response.response)
.filter((response: AuthStatusResponse) => isNotEmpty(response))
.map((response: AuthStatusResponse) => response.response)
.distinctUntilChanged());
}