Skip to content

Commit

Permalink
fix(foxy-customer-portal): hide password reset screen on success
Browse files Browse the repository at this point in the history
Closes #200
  • Loading branch information
pheekus committed Feb 13, 2025
1 parent 9683e29 commit 5e2e658
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,17 @@ export class InternalCustomerPortalPasswordResetView extends TranslatableMixin(I
this.edit({ password_old: this.passwordOld ?? '' });
super.submit();
}

protected async _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult> {
const request = new Request(...args);
if (request.method !== 'PATCH') return super._fetch<TResult>(...args);

const body = await request.json();
const data = await super._fetch<Data>(...args);

data.password_old = body.password_old;
data.password = body.password;

return data as unknown as TResult;
}
}

0 comments on commit 5e2e658

Please sign in to comment.