refactor: have UpdatePasswordFormRequest extend UpdatePasswordFormTypes

This commit is contained in:
Derrick Hammer 2024-03-19 10:23:03 -04:00
parent 03b1d761f0
commit 1dae0ba771
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import type {AuthProvider} from "@refinedev/core"
import type {AuthProvider, UpdatePasswordFormTypes} from "@refinedev/core"
import type {
AuthActionResponse,
@ -31,9 +31,8 @@ export type Identity = {
email: string;
}
export type UpdatePasswordFormRequest = {
export interface UpdatePasswordFormRequest extends UpdatePasswordFormTypes{
currentPassword: string;
newPassword: string;
}
export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
@ -102,7 +101,7 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
async updatePassword(params: UpdatePasswordFormRequest): Promise<AuthActionResponse> {
maybeSetupAuth();
const ret = await sdk.account().updatePassword(params.currentPassword, params.newPassword);
const ret = await sdk.account().updatePassword(params.currentPassword, params.password as string);
if (ret) {
if (ret instanceof Error) {