Compare commits
5 Commits
bec75e63ee
...
bba7ce59d3
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | bba7ce59d3 | |
Derrick Hammer | 9332598627 | |
Derrick Hammer | 6ce3b02dc6 | |
Derrick Hammer | 81d52d2524 | |
Derrick Hammer | 64e2216a36 |
|
@ -30,7 +30,7 @@ export const accountProvider: SdkProvider = {
|
|||
|
||||
if (ret) {
|
||||
if (ret instanceof Error) {
|
||||
return Promise.reject(ret)
|
||||
return Promise.reject(ret satisfies HttpError)
|
||||
}
|
||||
} else {
|
||||
return Promise.reject();
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +123,7 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
|
|||
},
|
||||
|
||||
async onError(error: any): Promise<OnErrorResponse> {
|
||||
return {logout: true};
|
||||
return {};
|
||||
},
|
||||
|
||||
async register(params: RegisterFormRequest): Promise<AuthActionResponse> {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"@conform-to/react": "^1.0.2",
|
||||
"@conform-to/zod": "^1.0.2",
|
||||
"@fontsource-variable/manrope": "^5.0.19",
|
||||
"@lumeweb/portal-sdk": "0.0.0-20240320165911",
|
||||
"@lumeweb/portal-sdk": "0.0.0-20240320201908",
|
||||
"@radix-ui/react-avatar": "^1.0.4",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
|
|
Loading…
Reference in New Issue