mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-05 19:52:15 +00:00
refactor(auth): update auth client to enhance type inference for user fields in auth structure
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import type { auth } from "@dokploy/server";
|
|
||||||
import {
|
import {
|
||||||
adminClient,
|
adminClient,
|
||||||
apiKeyClient,
|
apiKeyClient,
|
||||||
@@ -15,6 +14,12 @@ export const authClient = createAuthClient({
|
|||||||
twoFactorClient(),
|
twoFactorClient(),
|
||||||
apiKeyClient(),
|
apiKeyClient(),
|
||||||
adminClient(),
|
adminClient(),
|
||||||
inferAdditionalFields<typeof auth.api>(),
|
inferAdditionalFields({
|
||||||
|
user: {
|
||||||
|
lastName: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -271,14 +271,9 @@ const { handler, api } = betterAuth({
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
export const auth: {
|
export const auth = {
|
||||||
handler: typeof handler;
|
handler,
|
||||||
createApiKey: typeof api.createApiKey;
|
|
||||||
api: typeof api;
|
|
||||||
} = {
|
|
||||||
handler: handler,
|
|
||||||
createApiKey: api.createApiKey,
|
createApiKey: api.createApiKey,
|
||||||
api: api,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const validateRequest = async (request: IncomingMessage) => {
|
export const validateRequest = async (request: IncomingMessage) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user