Next.js Discord

Discord Forum

need help please ! betterAuth integration on NextJs 15.2

Unanswered
Black carp posted this in #help-forum
Open in Discord
Black carpOP
Hello. I've added this file myapp.fr\src\app\api\auth[...all]\route.ts with this code :

import { auth } from "@/lib/auth"; import { toNextJsHandler } from "better-auth/next-js"; console.log("✅ API /api/auth chargée avec BetterAuth !"); export const { POST, GET } = toNextJsHandler(auth);

and now when i go http://localhost:3000/api/auth i get error 404 i dont know why.

0 Replies