refactor: restructure auth export to improve type safety and clarity

This commit is contained in:
Mauricio Siu
2026-02-23 02:43:31 -06:00
parent d8e08558cc
commit 03969b8f45
+4 -1
View File
@@ -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) {