Compare commits
No commits in common. "bba7ce59d3abe936cba846b9c5224f75f0bb4f17" and "bec75e63eef7adf9a4f0ae4270d4b0fb2543e8ca" have entirely different histories.
bba7ce59d3
...
bec75e63ee
|
@ -30,7 +30,7 @@ export const accountProvider: SdkProvider = {
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (ret instanceof Error) {
|
if (ret instanceof Error) {
|
||||||
return Promise.reject(ret satisfies HttpError)
|
return Promise.reject(ret)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type {AuthProvider, HttpError, UpdatePasswordFormTypes} from "@refinedev/core"
|
import type {AuthProvider, UpdatePasswordFormTypes} from "@refinedev/core"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
AuthActionResponse,
|
AuthActionResponse,
|
||||||
|
@ -8,9 +8,10 @@ import type {
|
||||||
SuccessNotificationResponse
|
SuccessNotificationResponse
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
} from "@refinedev/core/dist/interfaces/bindings/auth"
|
} from "@refinedev/core/dist/interfaces/bindings/auth"
|
||||||
import {Sdk, AccountError} from "@lumeweb/portal-sdk";
|
import {Sdk} from "@lumeweb/portal-sdk";
|
||||||
import type {AccountInfoResponse} from "@lumeweb/portal-sdk";
|
import type {AccountInfoResponse} from "@lumeweb/portal-sdk";
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
export type AuthFormRequest = {
|
export type AuthFormRequest = {
|
||||||
email: string;
|
email: string;
|
||||||
|
@ -59,10 +60,10 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
|
||||||
|
|
||||||
const handleResponse = (result: ResponseResult): AuthActionResponse => {
|
const handleResponse = (result: ResponseResult): AuthActionResponse => {
|
||||||
if (result.ret) {
|
if (result.ret) {
|
||||||
if (result.ret instanceof AccountError) {
|
if (result.ret instanceof Error) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
error: result.ret satisfies HttpError,
|
error: result.ret,
|
||||||
redirectTo: result.redirectToError
|
redirectTo: result.redirectToError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +124,7 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
|
||||||
},
|
},
|
||||||
|
|
||||||
async onError(error: any): Promise<OnErrorResponse> {
|
async onError(error: any): Promise<OnErrorResponse> {
|
||||||
return {};
|
return {logout: true};
|
||||||
},
|
},
|
||||||
|
|
||||||
async register(params: RegisterFormRequest): Promise<AuthActionResponse> {
|
async register(params: RegisterFormRequest): Promise<AuthActionResponse> {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"@conform-to/react": "^1.0.2",
|
"@conform-to/react": "^1.0.2",
|
||||||
"@conform-to/zod": "^1.0.2",
|
"@conform-to/zod": "^1.0.2",
|
||||||
"@fontsource-variable/manrope": "^5.0.19",
|
"@fontsource-variable/manrope": "^5.0.19",
|
||||||
"@lumeweb/portal-sdk": "0.0.0-20240320201908",
|
"@lumeweb/portal-sdk": "0.0.0-20240320165911",
|
||||||
"@radix-ui/react-avatar": "^1.0.4",
|
"@radix-ui/react-avatar": "^1.0.4",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-dialog": "^1.0.5",
|
||||||
|
|
Loading…
Reference in New Issue