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

View File

@@ -348,13 +348,16 @@ const { handler, api } = betterAuth({
],
});
export const auth = {
const _auth = {
handler,
createApiKey: api.createApiKey,
registerSSOProvider: api.registerSSOProvider,
updateSSOProvider: api.updateSSOProvider,
};
export type AuthType = typeof _auth;
export const auth: AuthType = _auth;
export const validateRequest = async (request: IncomingMessage) => {
const apiKey = request.headers["x-api-key"] as string;
if (apiKey) {