Added spinner to shibboleth landing page

This commit is contained in:
Julius Gruber
2019-06-27 09:56:58 +02:00
parent 5d5f9c4046
commit 39fd025252
4 changed files with 19 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
<p>
<ds-loading *ngIf="(loading | async)" message="'Shibboleth log-in successfull. Please wait while we redirect you'" class="m-5"></ds-loading>
<!--<p>
Shibboleth login successfull! Please wait while we redirect you... Shibboleth login successfull! Please wait while we redirect you...
</p> </p>-->

View File

@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import {GetJWTafterShibbLoginAction} from '../../core/auth/auth.actions'; import {GetJWTafterShibbLoginAction} from '../../core/auth/auth.actions';
import {Store} from '@ngrx/store'; import {Store} from '@ngrx/store';
import {CoreState} from '../../core/core.reducers'; import {CoreState} from '../../core/core.reducers';
import {Observable, of} from 'rxjs';
@Component({ @Component({
selector: 'ds-shibboleth-page', selector: 'ds-shibboleth-page',
@@ -10,10 +11,17 @@ import {CoreState} from '../../core/core.reducers';
}) })
export class ShibbolethComponent implements OnInit { export class ShibbolethComponent implements OnInit {
constructor( private store: Store<CoreState>,) { } /**
* True if the authentication is loading.
* @type {boolean}
*/
public loading: Observable<boolean>;
ngOnInit() { ngOnInit() {
this.loading = of(true);
this.store.dispatch(new GetJWTafterShibbLoginAction()); this.store.dispatch(new GetJWTafterShibbLoginAction());
} }
constructor( private store: Store<CoreState>,) { }
} }

View File

@@ -56,7 +56,6 @@ export class AuthInterceptor implements HttpInterceptor {
private isLoginResponse(http: HttpRequest<any> | HttpResponseBase): boolean { private isLoginResponse(http: HttpRequest<any> | HttpResponseBase): boolean {
return http.url && http.url.endsWith('/authn/login') return http.url && http.url.endsWith('/authn/login')
/*|| http.url.endsWith('/shibboleth');*/
} }
private isLogoutResponse(http: HttpRequest<any> | HttpResponseBase): boolean { private isLogoutResponse(http: HttpRequest<any> | HttpResponseBase): boolean {
@@ -67,7 +66,7 @@ export class AuthInterceptor implements HttpInterceptor {
const authStatus = new AuthStatus(); const authStatus = new AuthStatus();
authStatus.id = null; authStatus.id = null;
authStatus.okay = true; authStatus.okay = true;
authStatus.ssoLoginUrl = location; // this line was added while developing shibboleth dev authStatus.ssoLoginUrl = location; // this line was added while developing shibboleth login
if (authenticated) { if (authenticated) {
authStatus.authenticated = true; authStatus.authenticated = true;
authStatus.token = new AuthTokenInfo(accessToken); authStatus.token = new AuthTokenInfo(accessToken);

View File

@@ -25,6 +25,7 @@
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit" <button class="btn btn-lg btn-primary btn-block mt-3" type="submit"
[disabled]="!form.valid">{{"login.form.submit" | translate}}</button> [disabled]="!form.valid">{{"login.form.submit" | translate}}</button>
<br> <br>
<div *ngIf="(hasSsoLoginUrl | async)"> <div *ngIf="(hasSsoLoginUrl | async)">
<!--<div class="text-center mt-2"><span class="align-middle">{{"login.form.or-divider" | translate}}</span></div>--> <!--<div class="text-center mt-2"><span class="align-middle">{{"login.form.or-divider" | translate}}</span></div>-->
@@ -32,14 +33,13 @@
role="button">{{"login.form.ssoLogin" | translate}}</a> role="button">{{"login.form.ssoLogin" | translate}}</a>
</div> </div>
<br>
<!-- <div> <div>
<br> <a class="btn btn-lg btn-primary btn-block mt-2"
<a class="btn btn-lg btn-primary btn-block mt-2"
href="https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https://fis.tiss.tuwien.ac.at/shibboleth" href="https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https://fis.tiss.tuwien.ac.at/shibboleth"
role="button" role="button"
>HardCoded Shibb</a> >HardCoded Shibb</a>
</div>--> </div>
<!-- <div > <!-- <div >