diff --git a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts index d30d324d2a..5735624f66 100644 --- a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts +++ b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts @@ -13,8 +13,6 @@ import { AuthService } from '../../../../core/auth/auth.service'; import { HardRedirectService } from '../../../../core/services/hard-redirect.service'; import { URLCombiner } from '../../../../core/url-combiner/url-combiner'; import { CoreState } from '../../../../core/core-state.model'; -import { renderAuthMethodFor } from '../log-in.methods-decorator'; -import { AuthMethodType } from '../../../../core/auth/models/auth.method-type'; import { TranslateModule } from '@ngx-translate/core'; @Component({ @@ -24,9 +22,6 @@ import { TranslateModule } from '@ngx-translate/core'; standalone: true, imports: [TranslateModule] }) -@renderAuthMethodFor(AuthMethodType.Oidc) -@renderAuthMethodFor(AuthMethodType.Shibboleth) -@renderAuthMethodFor(AuthMethodType.Orcid) export class LogInExternalProviderComponent implements OnInit { /** diff --git a/src/app/shared/log-in/methods/log-in.methods-decorator.ts b/src/app/shared/log-in/methods/log-in.methods-decorator.ts index e30a4813dd..ac9b53379a 100644 --- a/src/app/shared/log-in/methods/log-in.methods-decorator.ts +++ b/src/app/shared/log-in/methods/log-in.methods-decorator.ts @@ -1,8 +1,14 @@ import { Component, Type } from '@angular/core'; import { AuthMethodType } from '../../../core/auth/models/auth.method-type'; +import { LogInPasswordComponent } from './password/log-in-password.component'; +import { LogInExternalProviderComponent } from './log-in-external-provider/log-in-external-provider.component'; -const authMethodsMap: Map> = new Map(); +const authMethodsMap: Map = new Map(); +authMethodsMap.set(AuthMethodType.Password, LogInPasswordComponent); +authMethodsMap.set(AuthMethodType.Shibboleth, LogInExternalProviderComponent); +authMethodsMap.set(AuthMethodType.Oidc, LogInExternalProviderComponent); +authMethodsMap.set(AuthMethodType.Orcid, LogInExternalProviderComponent); export function renderAuthMethodFor(authMethodType: AuthMethodType) { return function decorator(objectElement: any) { if (!objectElement) { diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index ac1db8330f..80fdf69b2d 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -1,6 +1,6 @@ import { map } from 'rxjs/operators'; import { Component, Inject, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { select, Store } from '@ngrx/store'; import { Observable } from 'rxjs'; @@ -9,8 +9,6 @@ import { AuthenticateAction, ResetAuthenticationMessagesAction } from '../../../ import { getAuthenticationError, getAuthenticationInfo, } from '../../../../core/auth/selectors'; import { isNotEmpty } from '../../../empty.util'; import { fadeOut } from '../../../animations/fade'; -import { AuthMethodType } from '../../../../core/auth/models/auth.method-type'; -import { renderAuthMethodFor } from '../log-in.methods-decorator'; import { AuthMethod } from '../../../../core/auth/models/auth.method'; import { AuthService } from '../../../../core/auth/auth.service'; import { HardRedirectService } from '../../../../core/services/hard-redirect.service'; @@ -21,7 +19,7 @@ import { AuthorizationDataService } from '../../../../core/data/feature-authoriz import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; import { TranslateModule } from '@ngx-translate/core'; import { RouterLink } from '@angular/router'; -import { NgIf, AsyncPipe } from '@angular/common'; +import { AsyncPipe, NgIf } from '@angular/common'; /** * /users/sign-in @@ -35,7 +33,6 @@ import { NgIf, AsyncPipe } from '@angular/common'; standalone: true, imports: [FormsModule, ReactiveFormsModule, NgIf, RouterLink, AsyncPipe, TranslateModule, BrowserOnlyPipe] }) -@renderAuthMethodFor(AuthMethodType.Password) export class LogInPasswordComponent implements OnInit { /**