From 5e2e658cd17b0e1fbe9fdd035bf5d21fcc4a9d74 Mon Sep 17 00:00:00 2001 From: Daniil Bratukhin Date: Thu, 13 Feb 2025 17:31:15 -0300 Subject: [PATCH] fix(foxy-customer-portal): hide password reset screen on success Closes #200 --- .../InternalCustomerPortalPasswordResetView.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.ts b/src/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.ts index d3a32258..cdf5bbd1 100644 --- a/src/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.ts +++ b/src/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.ts @@ -89,4 +89,17 @@ export class InternalCustomerPortalPasswordResetView extends TranslatableMixin(I this.edit({ password_old: this.passwordOld ?? '' }); super.submit(); } + + protected async _fetch(...args: Parameters): Promise { + const request = new Request(...args); + if (request.method !== 'PATCH') return super._fetch(...args); + + const body = await request.json(); + const data = await super._fetch(...args); + + data.password_old = body.password_old; + data.password = body.password; + + return data as unknown as TResult; + } }