Test CORS policy'

This commit is contained in:
Julius Gruber
2019-06-18 14:30:02 +02:00
parent 8ed359cc7e
commit 4504fa1818
7 changed files with 109 additions and 3 deletions

View File

@@ -26,7 +26,11 @@ import {
RefreshTokenSuccessAction,
RegistrationAction,
RegistrationErrorAction,
RegistrationSuccessAction, RetrieveAuthMethodsAction, RetrieveAuthMethodsErrorAction, RetrieveAuthMethodsSuccessAction
RegistrationSuccessAction,
RetrieveAuthMethodsAction,
RetrieveAuthMethodsErrorAction,
RetrieveAuthMethodsSuccessAction,
ShibbLoginAction
} from './auth.actions';
import { EPerson } from '../eperson/models/eperson.model';
import { AuthStatus } from './models/auth-status.model';
@@ -54,6 +58,22 @@ export class AuthEffects {
})
);
/**
* Shib Login.
* @method shibLogin
*/
@Effect()
public shibbLogin$: Observable<Action> = this.actions$.pipe(
ofType(AuthActionTypes.SHIBB_LOGIN),
switchMap((action: ShibbLoginAction) => {
return this.authService.startShibbAuth().pipe(
take(1),
map((response: AuthStatus) => new AuthenticationSuccessAction(response.token)),
catchError((error) => observableOf(new AuthenticationErrorAction(error)))
);
})
);
@Effect()
public authenticateSuccess$: Observable<Action> = this.actions$.pipe(
ofType(AuthActionTypes.AUTHENTICATE_SUCCESS),