Skip to content

Commit c7fcea7

Browse files
author
Mauricio Siu
committed
refactor(auth): update auth client to enhance type inference for user fields in auth structure
1 parent d4555e6 commit c7fcea7

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/dokploy/lib/auth-client.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { auth } from "@dokploy/server";
21
import {
32
adminClient,
43
apiKeyClient,
@@ -15,6 +14,12 @@ export const authClient = createAuthClient({
1514
twoFactorClient(),
1615
apiKeyClient(),
1716
adminClient(),
18-
inferAdditionalFields<typeof auth.api>(),
17+
inferAdditionalFields({
18+
user: {
19+
lastName: {
20+
type: "string",
21+
},
22+
},
23+
}),
1924
],
2025
});

packages/server/src/lib/auth.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,9 @@ const { handler, api } = betterAuth({
271271
],
272272
});
273273

274-
export const auth: {
275-
handler: typeof handler;
276-
createApiKey: typeof api.createApiKey;
277-
api: typeof api;
278-
} = {
279-
handler: handler,
274+
export const auth = {
275+
handler,
280276
createApiKey: api.createApiKey,
281-
api: api,
282277
};
283278

284279
export const validateRequest = async (request: IncomingMessage) => {

0 commit comments

Comments
 (0)