mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-29 10:26:49 -05:00
fix: allow custom body properties
This commit is contained in:
@@ -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<T> = UnionToIntersection<T>;
|
||||
|
||||
export type InferReturn<R, O extends ClientOptions> = R extends Record<
|
||||
string,
|
||||
any
|
||||
>
|
||||
? StripEmptyObjects<
|
||||
{
|
||||
user: R extends { user: any } ? InferUserFromClient<O> : never;
|
||||
users: R extends { users: any[] } ? InferUserFromClient<O>[] : never;
|
||||
session: R extends { session: any } ? InferSessionFromClient<O> : never;
|
||||
sessions: R extends { sessions: any[] }
|
||||
? InferSessionFromClient<O>[]
|
||||
: never;
|
||||
} & {
|
||||
[key in Exclude<
|
||||
keyof R,
|
||||
"user" | "users" | "session" | "sessions"
|
||||
>]: R[key];
|
||||
}
|
||||
>
|
||||
: R;
|
||||
|
||||
export type InferRoute<API, COpts extends ClientOptions> = API extends Record<
|
||||
string,
|
||||
infer T
|
||||
@@ -116,8 +94,8 @@ export type InferRoute<API, COpts extends ClientOptions> = API extends Record<
|
||||
? C extends Context<any, any>
|
||||
? <
|
||||
FetchOptions extends BetterFetchOption<
|
||||
C["body"],
|
||||
C["query"],
|
||||
C["body"] & Record<string, any>,
|
||||
C["query"] & Record<string, any>,
|
||||
C["params"]
|
||||
>,
|
||||
>(
|
||||
|
||||
Reference in New Issue
Block a user