mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +00:00
Added logs for server debug
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -64,7 +64,7 @@ export class AuthEffects {
|
||||
*/
|
||||
@Effect()
|
||||
public shibbLogin$: Observable<Action> = this.actions$.pipe(
|
||||
ofType(AuthActionTypes.SHIBB_LOGIN),
|
||||
ofType(AuthActionTypes.GET_JWT_AFTER_SHIBB_LOGIN),
|
||||
switchMap((action: GetJWTafterShibbLoginAction) => {
|
||||
return this.authService.startShibbAuth().pipe(
|
||||
take(1),
|
||||
|
@@ -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,
|
||||
|
@@ -33,6 +33,11 @@
|
||||
role="button">{{"login.form.ssoLogin" | translate}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
<!--Change href to "https://dspace.hostname/Shibboleth.sso/Login?target=https://dspace.hostname/shibboleth"
|
||||
to make this work with your Shibboleth IdentityProvider and Service Provider. dspace.hostname = as in the
|
||||
backend config file "dspace.cfg". Do not change the following parts of href:
|
||||
"/Shibboleth.sso/Login?target=" and "/shibboleth" at the end of href -->
|
||||
<br>
|
||||
<div>
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2"
|
||||
@@ -42,17 +47,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div >
|
||||
<br>
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2" (click)="dispatchShibbLoginAction()" role="button">Dispatch Shibb Login</a>
|
||||
</div>-->
|
||||
|
||||
|
||||
<!-- <div >
|
||||
<br>
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2" (click)="postLoginCall()" role="button">Simple Post Login</a>
|
||||
</div>-->
|
||||
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">{{"login.form.new-user" | translate}}</a>
|
||||
|
@@ -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));
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user