mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-29 14:48:47 +00:00
refactor: restructure auth export to improve type safety and clarity
This commit is contained in:
@@ -348,13 +348,16 @@ const { handler, api } = betterAuth({
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
export const auth = {
|
const _auth = {
|
||||||
handler,
|
handler,
|
||||||
createApiKey: api.createApiKey,
|
createApiKey: api.createApiKey,
|
||||||
registerSSOProvider: api.registerSSOProvider,
|
registerSSOProvider: api.registerSSOProvider,
|
||||||
updateSSOProvider: api.updateSSOProvider,
|
updateSSOProvider: api.updateSSOProvider,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AuthType = typeof _auth;
|
||||||
|
export const auth: AuthType = _auth;
|
||||||
|
|
||||||
export const validateRequest = async (request: IncomingMessage) => {
|
export const validateRequest = async (request: IncomingMessage) => {
|
||||||
const apiKey = request.headers["x-api-key"] as string;
|
const apiKey = request.headers["x-api-key"] as string;
|
||||||
if (apiKey) {
|
if (apiKey) {
|
||||||
|
|||||||
Reference in New Issue
Block a user