From 0a5b19487063bbb3f7f685a96cc253489c41f3d2 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Mon, 27 Jan 2025 23:41:39 +0200 Subject: [PATCH] handle reactivation backend errors --- src/app/core/register2/register2.backend-validators.ts | 6 ++++-- src/app/register2/pages/register/register2.component.ts | 3 ++- src/app/types/register.endpoint.ts | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/core/register2/register2.backend-validators.ts b/src/app/core/register2/register2.backend-validators.ts index 5d730df0ad..9b51db535b 100644 --- a/src/app/core/register2/register2.backend-validators.ts +++ b/src/app/core/register2/register2.backend-validators.ts @@ -25,7 +25,8 @@ interface HasFormAdapters { StepB: UntypedFormGroup, StepC: UntypedFormGroup, StepC2: UntypedFormGroup, - StepD: UntypedFormGroup + StepD: UntypedFormGroup, + isReactivation?: boolean ): RegisterForm } @@ -164,7 +165,7 @@ export function Register2BackendValidatorMixin< StepC: UntypedFormGroup, StepC2: UntypedFormGroup, StepD: UntypedFormGroup, - + isReactivation?: boolean, type?: 'shibboleth' ): Observable { const registerForm = this.formGroupToFullRegistrationForm( @@ -174,6 +175,7 @@ export function Register2BackendValidatorMixin< StepC2, StepD ) + registerForm.isReactivation = isReactivation return this._http .post(`${environment.API_WEB}register.json`, registerForm) .pipe( diff --git a/src/app/register2/pages/register/register2.component.ts b/src/app/register2/pages/register/register2.component.ts index b1312b971c..1fbf664607 100644 --- a/src/app/register2/pages/register/register2.component.ts +++ b/src/app/register2/pages/register/register2.component.ts @@ -176,7 +176,8 @@ export class Register2Component implements OnInit, AfterViewInit { this.FormGroupStepB, this.FormGroupStepC, this.FormGroupStepC2, - this.FormGroupStepD + this.FormGroupStepD, + this.reactivation?.isReactivation ) .pipe( switchMap((validator: RegisterForm) => { diff --git a/src/app/types/register.endpoint.ts b/src/app/types/register.endpoint.ts index edfd755d85..839306f60e 100644 --- a/src/app/types/register.endpoint.ts +++ b/src/app/types/register.endpoint.ts @@ -28,6 +28,7 @@ export interface RegisterForm { emailAccessAllowed?: boolean redirectUrl?: any resetParams?: string + isReactivation?: boolean } export interface DuplicatedName {