From 9332598627c60e9902bffcf7e5820d31f47b244b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 20 Mar 2024 16:21:56 -0400 Subject: [PATCH] refactor: pass ret as a HttpError --- app/data/auth-provider.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/data/auth-provider.ts b/app/data/auth-provider.ts index d6d38eb..3f696ed 100644 --- a/app/data/auth-provider.ts +++ b/app/data/auth-provider.ts @@ -1,4 +1,4 @@ -import type {AuthProvider, UpdatePasswordFormTypes} from "@refinedev/core" +import type {AuthProvider, HttpError, UpdatePasswordFormTypes} from "@refinedev/core" import type { AuthActionResponse, @@ -8,10 +8,9 @@ import type { SuccessNotificationResponse // @ts-ignore } from "@refinedev/core/dist/interfaces/bindings/auth" -import {Sdk} from "@lumeweb/portal-sdk"; +import {Sdk, AccountError} from "@lumeweb/portal-sdk"; import type {AccountInfoResponse} from "@lumeweb/portal-sdk"; -; export type AuthFormRequest = { email: string; @@ -60,10 +59,10 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => { const handleResponse = (result: ResponseResult): AuthActionResponse => { if (result.ret) { - if (result.ret instanceof Error) { + if (result.ret instanceof AccountError) { return { success: false, - error: result.ret, + error: result.ret satisfies HttpError, redirectTo: result.redirectToError } }