diff --git a/src/app/core/auth/auth.actions.ts b/src/app/core/auth/auth.actions.ts index c79f250e09..b0343e2dc8 100644 --- a/src/app/core/auth/auth.actions.ts +++ b/src/app/core/auth/auth.actions.ts @@ -10,7 +10,7 @@ import {AuthTokenInfo} from './models/auth-token-info.model'; export const AuthActionTypes = { AUTHENTICATE: type('dspace/auth/AUTHENTICATE'), - SHIBB_LOGIN: type('dspace/auth/SHIBB_LOGIN'), + GET_JWT_AFTER_SHIBB_LOGIN: type('dspace/auth/GET_JWT_AFTER_SHIBB_LOGIN'), AUTHENTICATE_ERROR: type('dspace/auth/AUTHENTICATE_ERROR'), AUTHENTICATE_SUCCESS: type('dspace/auth/AUTHENTICATE_SUCCESS'), AUTHENTICATED: type('dspace/auth/AUTHENTICATED'), @@ -62,7 +62,7 @@ export class AuthenticateAction implements Action { * @implements {Action} */ export class GetJWTafterShibbLoginAction implements Action { - public type: string = AuthActionTypes.SHIBB_LOGIN; + public type: string = AuthActionTypes.GET_JWT_AFTER_SHIBB_LOGIN; } /** diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 40d46944a7..eb7bdaf42c 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -64,7 +64,7 @@ export class AuthEffects { */ @Effect() public shibbLogin$: Observable = this.actions$.pipe( - ofType(AuthActionTypes.SHIBB_LOGIN), + ofType(AuthActionTypes.GET_JWT_AFTER_SHIBB_LOGIN), switchMap((action: GetJWTafterShibbLoginAction) => { return this.authService.startShibbAuth().pipe( take(1), diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index f39421f1b1..745a8debe3 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -78,7 +78,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut info: undefined }); - case AuthActionTypes.SHIBB_LOGIN: + case AuthActionTypes.GET_JWT_AFTER_SHIBB_LOGIN: return Object.assign({}, state, { error: undefined, loading: true, diff --git a/src/app/shared/log-in/log-in.component.html b/src/app/shared/log-in/log-in.component.html index 7046eb3a7e..a4c1cb9e87 100644 --- a/src/app/shared/log-in/log-in.component.html +++ b/src/app/shared/log-in/log-in.component.html @@ -33,6 +33,11 @@ role="button">{{"login.form.ssoLogin" | translate}} + +
- - - {{"login.form.new-user" | translate}} diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts index 034b7125fe..52fe45e608 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -112,7 +112,7 @@ export class LogInComponent implements OnDestroy, OnInit { * @method ngOnInit */ public ngOnInit() { - console.log('log-in.componetn.ngOnInit() called'); + console.log('log-in.component.ngOnInit() called'); // set isAuthenticated this.isAuthenticated = this.store.pipe(select(isAuthenticated)); @@ -145,6 +145,7 @@ export class LogInComponent implements OnDestroy, OnInit { // set sso login url this.ssoLoginUrl = this.store.pipe(select(getSSOLoginUrl)); + this.ssoLoginUrl.subscribe((url) => console.log('url after store select: ', url)); // subscribe to success this.store.pipe( @@ -211,34 +212,4 @@ export class LogInComponent implements OnDestroy, OnInit { this.form.reset(); } -/* public postLoginCall() { - console.log('postLoginCall() was called'); - /!* const email = 'test@test.at'; - const password = 'test'; - this.store.dispatch(new AuthenticateAction(email, password));*!/ - this.http.post('https://fis.tiss.tuwien.ac.at/spring-rest/api/authn/login', - { - name: 'morpheus', - job: 'leader' - }) - .subscribe( - (val) => { - console.log('POST call successful value returned in body', - val); - }, - (response) => { - console.log('POST call in error', response); - }, - () => { - console.log('The POST observable is now completed.'); - }); - }*/ - - dispatchShibbLoginAction() { - console.log('dispatchShibbLoginAction() was called'); - // const ssoLoginUrl = 'https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login' - this.store.dispatch(new GetJWTafterShibbLoginAction()); - // this.store.dispatch(new AuthenticateAction(email, password)); - - } }