Changed auth-interceptor: location used to makeAuthStatusObject()

This commit is contained in:
Julius Gruber
2019-06-03 09:57:52 +02:00
parent 10085ccf41
commit 70d95b4764
5 changed files with 88 additions and 36 deletions

View File

@@ -26,7 +26,7 @@ import {
RefreshTokenSuccessAction,
RegistrationAction,
RegistrationErrorAction,
RegistrationSuccessAction
RegistrationSuccessAction, RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction
} from './auth.actions';
import { EPerson } from '../eperson/models/eperson.model';
import { AuthStatus } from './models/auth-status.model';
@@ -169,6 +169,19 @@ export class AuthEffects {
tap(() => this.authService.redirectToLoginWhenTokenExpired())
);
@Effect()
public retrieveMethods$: Observable<Action> = this.actions$
.pipe(
ofType(AuthActionTypes.RETRIEVE_AUTH_METHODS),
switchMap(() => {
return this.authService.retrieveAuthMethods()
.pipe(
map((location: any) => new RetrieveAuthMethodsSuccessAction(location)),
catchError((error) => observableOf(new RetrieveAuthMethodsErrorAction()))
)
})
)
/**
* @constructor
* @param {Actions} actions$