forked from hazza/dspace-angular
Merge pull request #2032 from mspalti/fix-login-menu
Ignore IP authentication method in login component.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<ds-themed-loading *ngIf="(loading | async) || (isAuthenticated | async)" class="m-5"></ds-themed-loading>
|
||||
<div *ngIf="!(loading | async) && !(isAuthenticated | async)" class="px-4 py-3 login-container">
|
||||
<ng-container *ngFor="let authMethod of (authMethods | async); let i = index">
|
||||
<ng-container *ngFor="let authMethod of (authMethods); let i = index">
|
||||
<div *ngIf="i === 1" class="text-center mt-2">
|
||||
<span class="align-middle">{{"login.form.or-divider" | translate}}</span>
|
||||
</div>
|
||||
|
@@ -14,6 +14,7 @@ import { AuthService } from '../../core/auth/auth.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { CoreState } from '../../core/core-state.model';
|
||||
import { AuthMethodType } from '../../core/auth/models/auth.method-type';
|
||||
|
||||
/**
|
||||
* /users/sign-in
|
||||
@@ -36,7 +37,7 @@ export class LogInComponent implements OnInit {
|
||||
* The list of authentication methods available
|
||||
* @type {AuthMethod[]}
|
||||
*/
|
||||
public authMethods: Observable<AuthMethod[]>;
|
||||
public authMethods: AuthMethod[];
|
||||
|
||||
/**
|
||||
* Whether user is authenticated.
|
||||
@@ -62,9 +63,12 @@ export class LogInComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
this.authMethods = this.store.pipe(
|
||||
this.store.pipe(
|
||||
select(getAuthenticationMethods),
|
||||
);
|
||||
).subscribe(methods => {
|
||||
// ignore the ip authentication method when it's returned by the backend
|
||||
this.authMethods = methods.filter(a => a.authMethodType !== AuthMethodType.Ip);
|
||||
});
|
||||
|
||||
// set loading
|
||||
this.loading = this.store.pipe(select(isAuthenticationLoading));
|
||||
|
Reference in New Issue
Block a user