2024-03-07 14:04:59 +00:00
|
|
|
import { AuthProvider } from "@refinedev/core"
|
|
|
|
import type {
|
|
|
|
AuthActionResponse,
|
|
|
|
CheckResponse,
|
|
|
|
OnErrorResponse
|
2024-03-13 13:38:22 +00:00
|
|
|
// @ts-ignore
|
|
|
|
} from "@refinedev/core/dist/interfaces/bindings/auth"
|
2024-03-07 14:04:59 +00:00
|
|
|
|
|
|
|
export const authProvider: AuthProvider = {
|
|
|
|
login: async (params: any) => {
|
|
|
|
return { success: true } satisfies AuthActionResponse
|
|
|
|
},
|
|
|
|
logout: async (params: any) => {
|
|
|
|
return { success: true } satisfies AuthActionResponse
|
|
|
|
},
|
|
|
|
check: async (params?: any) => {
|
|
|
|
return { authenticated: true } satisfies CheckResponse
|
|
|
|
},
|
|
|
|
onError: async (error: any) => {
|
|
|
|
return { logout: true } satisfies OnErrorResponse
|
|
|
|
},
|
|
|
|
register: async (params: any) => {
|
|
|
|
return { success: true } satisfies AuthActionResponse
|
|
|
|
},
|
|
|
|
forgotPassword: async (params: any) => {
|
|
|
|
return { success: true } satisfies AuthActionResponse
|
|
|
|
},
|
|
|
|
updatePassword: async (params: any) => {
|
|
|
|
return { success: true } satisfies AuthActionResponse
|
|
|
|
},
|
|
|
|
getPermissions: async (params: any) => {
|
|
|
|
return { success: true } satisfies AuthActionResponse
|
|
|
|
},
|
2024-03-13 13:38:22 +00:00
|
|
|
getIdentity: async (params: any) => {
|
2024-03-07 14:04:59 +00:00
|
|
|
return { id: "1", fullName: "John Doe", avatar: "https://via.placeholder.com/150" }
|
|
|
|
}
|
|
|
|
}
|