Fix: Use toNextJsHandler from better-auth for Next.js 16 route handler
The auth endpoint was returning 404 because the route handler wasn't properly using better-auth's Next.js integration. Use toNextJsHandler() to properly export the handlers.
This commit is contained in:
parent
67f24f4cd7
commit
094853c9da
2 changed files with 2 additions and 7 deletions
|
|
@ -1,9 +1,4 @@
|
||||||
import { auth } from '@/lib/auth';
|
import { auth } from '@/lib/auth';
|
||||||
|
import { toNextJsHandler } from 'better-auth/next-js';
|
||||||
|
|
||||||
const handler = auth.handler;
|
export const { GET, POST, PUT, PATCH, DELETE } = toNextJsHandler(auth);
|
||||||
|
|
||||||
export const GET = handler;
|
|
||||||
export const POST = handler;
|
|
||||||
export const PATCH = handler;
|
|
||||||
export const PUT = handler;
|
|
||||||
export const DELETE = handler;
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Reference in a new issue