mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Added shibboleth button to log-in.component
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
<div *ngIf="(error | async) && hasError" class="alert alert-danger" role="alert" @fadeOut>{{ (error | async) | translate }}</div>
|
||||
<div *ngIf="(message | async) && hasMessage" class="alert alert-info" role="alert" @fadeOut>{{ (message | async) | translate }}</div>
|
||||
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit" [disabled]="!form.valid">{{"login.form.submit" | translate}}</button>
|
||||
<div *ngIf="(hasSsoLoginUrl | async)">
|
||||
<div class="text-center mt-2"><span class="align-middle">{{"login.form.or-divider" | translate}}</span></div>
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2" [href]="(ssoLoginUrl | async)" role="button">{{"login.form.ssoLogin" | translate}}</a>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">{{"login.form.new-user" | translate}}</a>
|
||||
<a class="dropdown-item" href="#">{{"login.form.forgot-password" | translate}}</a>
|
||||
|
@@ -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)))
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user