basePath does not work in Next.js

I move files form src/app/api/auth/[..all] to src/app/api/v1/auth/[..all]

and I add basePath to betterAuth -> basePath: "/api/v1/auth"

export const auth = betterAuth({
basePath:/api/v1/auth"
database: drizzleAdapter(db, { provider: "pg" }),
emailAndPassword: { enabled: true, autoSignIn: false },
});


when creating a new user i got this:
POST /api/auth/sign-up/email?currentURL=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fnew 404

the request path does not change to api/auth/auth/...
Was this page helpful?