Added shibboleth button to log-in.component

This commit is contained in:
Julius Gruber
2019-06-03 10:30:01 +02:00
parent d6eab441a4
commit b4f3bf71ad
2 changed files with 23 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ import {
import {
getAuthenticationError,
getAuthenticationInfo,
getAuthenticationInfo, getSSOLoginUrl,
isAuthenticated,
isAuthenticationLoading,
} from '../../core/auth/selectors';
@@ -81,6 +81,18 @@ export class LogInComponent implements OnDestroy, OnInit {
*/
private alive = true;
/**
* The redirect url to login with sso.
* @type {Observable<string>}
*/
public ssoLoginUrl: Observable<string>;
/**
* True if is present the url to login with sso.
* @type {Observable<boolean>}
*/
public hasSsoLoginUrl: Observable<boolean>;
/**
* @constructor
* @param {AuthService} authService
@@ -129,6 +141,9 @@ export class LogInComponent implements OnDestroy, OnInit {
// set loading
this.loading = this.store.pipe(select(isAuthenticationLoading));
// set sso login url
this.ssoLoginUrl = this.store.pipe(select(getSSOLoginUrl));
// subscribe to success
this.store.pipe(
select(isAuthenticated),
@@ -138,6 +153,9 @@ export class LogInComponent implements OnDestroy, OnInit {
this.authService.redirectToPreviousUrl();
}
);
this.hasSsoLoginUrl = this.ssoLoginUrl
.pipe(map((url) => isNotEmpty(url)))
}
/**