mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
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>
|
<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">
|
<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">
|
<div *ngIf="i === 1" class="text-center mt-2">
|
||||||
<span class="align-middle">{{"login.form.or-divider" | translate}}</span>
|
<span class="align-middle">{{"login.form.or-divider" | translate}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -14,6 +14,7 @@ import { AuthService } from '../../core/auth/auth.service';
|
|||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||||
import { CoreState } from '../../core/core-state.model';
|
import { CoreState } from '../../core/core-state.model';
|
||||||
|
import { AuthMethodType } from '../../core/auth/models/auth.method-type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* /users/sign-in
|
* /users/sign-in
|
||||||
@@ -36,7 +37,7 @@ export class LogInComponent implements OnInit {
|
|||||||
* The list of authentication methods available
|
* The list of authentication methods available
|
||||||
* @type {AuthMethod[]}
|
* @type {AuthMethod[]}
|
||||||
*/
|
*/
|
||||||
public authMethods: Observable<AuthMethod[]>;
|
public authMethods: AuthMethod[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether user is authenticated.
|
* Whether user is authenticated.
|
||||||
@@ -62,9 +63,12 @@ export class LogInComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
||||||
this.authMethods = this.store.pipe(
|
this.store.pipe(
|
||||||
select(getAuthenticationMethods),
|
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
|
// set loading
|
||||||
this.loading = this.store.pipe(select(isAuthenticationLoading));
|
this.loading = this.store.pipe(select(isAuthenticationLoading));
|
||||||
|
Reference in New Issue
Block a user