10 lines
309 B
TypeScript
10 lines
309 B
TypeScript
import { toNextJsHandler } from 'better-auth/next-js';
|
|
import { ensureAuthSchema } from '@/lib/auth';
|
|
|
|
const authHandler = toNextJsHandler(async (request: Request) => {
|
|
const auth = await ensureAuthSchema();
|
|
return auth.handler(request);
|
|
});
|
|
|
|
export const { GET, POST, PATCH, PUT, DELETE } = authHandler;
|