diff --git a/packages/better-auth/src/client/path-to-object.ts b/packages/better-auth/src/client/path-to-object.ts index 2e85da1adb..e691268f54 100644 --- a/packages/better-auth/src/client/path-to-object.ts +++ b/packages/better-auth/src/client/path-to-object.ts @@ -6,7 +6,6 @@ import type { Context, Endpoint } from "better-call"; import type { HasRequiredKeys, Prettify, - StripEmptyObjects, UnionToIntersection, } from "../types/helper"; import type { @@ -76,27 +75,6 @@ export type InferCtx< export type MergeRoutes = UnionToIntersection; -export type InferReturn = R extends Record< - string, - any -> - ? StripEmptyObjects< - { - user: R extends { user: any } ? InferUserFromClient : never; - users: R extends { users: any[] } ? InferUserFromClient[] : never; - session: R extends { session: any } ? InferSessionFromClient : never; - sessions: R extends { sessions: any[] } - ? InferSessionFromClient[] - : never; - } & { - [key in Exclude< - keyof R, - "user" | "users" | "session" | "sessions" - >]: R[key]; - } - > - : R; - export type InferRoute = API extends Record< string, infer T @@ -116,8 +94,8 @@ export type InferRoute = API extends Record< ? C extends Context ? < FetchOptions extends BetterFetchOption< - C["body"], - C["query"], + C["body"] & Record, + C["query"] & Record, C["params"] >, >(