refactor(auth): update auth client to enhance type inference for user fields in auth structure

This commit is contained in:
Mauricio Siu
2025-12-07 04:34:49 -06:00
parent d4555e6985
commit c7fcea7d6a
2 changed files with 9 additions and 9 deletions

View File

@@ -1,4 +1,3 @@
import type { auth } from "@dokploy/server";
import {
adminClient,
apiKeyClient,
@@ -15,6 +14,12 @@ export const authClient = createAuthClient({
twoFactorClient(),
apiKeyClient(),
adminClient(),
inferAdditionalFields<typeof auth.api>(),
inferAdditionalFields({
user: {
lastName: {
type: "string",
},
},
}),
],
});

View File

@@ -271,14 +271,9 @@ const { handler, api } = betterAuth({
],
});
export const auth: {
handler: typeof handler;
createApiKey: typeof api.createApiKey;
api: typeof api;
} = {
handler: handler,
export const auth = {
handler,
createApiKey: api.createApiKey,
api: api,
};
export const validateRequest = async (request: IncomingMessage) => {