Skip to content

Commit ab3255f

Browse files
committed
fix: allow custom body properties
1 parent 779f8aa commit ab3255f

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

packages/better-auth/src/client/path-to-object.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type { Context, Endpoint } from "better-call";
66
import type {
77
HasRequiredKeys,
88
Prettify,
9-
StripEmptyObjects,
109
UnionToIntersection,
1110
} from "../types/helper";
1211
import type {
@@ -76,27 +75,6 @@ export type InferCtx<
7675

7776
export type MergeRoutes<T> = UnionToIntersection<T>;
7877

79-
export type InferReturn<R, O extends ClientOptions> = R extends Record<
80-
string,
81-
any
82-
>
83-
? StripEmptyObjects<
84-
{
85-
user: R extends { user: any } ? InferUserFromClient<O> : never;
86-
users: R extends { users: any[] } ? InferUserFromClient<O>[] : never;
87-
session: R extends { session: any } ? InferSessionFromClient<O> : never;
88-
sessions: R extends { sessions: any[] }
89-
? InferSessionFromClient<O>[]
90-
: never;
91-
} & {
92-
[key in Exclude<
93-
keyof R,
94-
"user" | "users" | "session" | "sessions"
95-
>]: R[key];
96-
}
97-
>
98-
: R;
99-
10078
export type InferRoute<API, COpts extends ClientOptions> = API extends Record<
10179
string,
10280
infer T
@@ -116,8 +94,8 @@ export type InferRoute<API, COpts extends ClientOptions> = API extends Record<
11694
? C extends Context<any, any>
11795
? <
11896
FetchOptions extends BetterFetchOption<
119-
C["body"],
120-
C["query"],
97+
C["body"] & Record<string, any>,
98+
C["query"] & Record<string, any>,
12199
C["params"]
122100
>,
123101
>(

0 commit comments

Comments
 (0)