From 357525e68ac830b33062c70a73db28fc1478ab42 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Mon, 9 Jan 2023 10:32:49 -0800 Subject: [PATCH 1/2] Ignore IP authentication method in login component. lint fix using enum Simplified assignment. --- src/app/shared/log-in/log-in.component.html | 2 +- src/app/shared/log-in/log-in.component.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/shared/log-in/log-in.component.html b/src/app/shared/log-in/log-in.component.html index 6e4685a07b..36f7034f4d 100644 --- a/src/app/shared/log-in/log-in.component.html +++ b/src/app/shared/log-in/log-in.component.html @@ -1,6 +1,6 @@
- +
{{"login.form.or-divider" | translate}}
diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts index 120f3ac4fa..cb47d49f88 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -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; + 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)); From 65af3973ba86bb4d4b300873784f84165c4b8c8a Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Wed, 11 Jan 2023 12:03:19 -0800 Subject: [PATCH 2/2] fixed lint error --- src/app/shared/log-in/log-in.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts index cb47d49f88..e6b2ba9dcf 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -67,7 +67,7 @@ export class LogInComponent implements OnInit { 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) + this.authMethods = methods.filter(a => a.authMethodType !== AuthMethodType.Ip); }); // set loading