From 094853c9da229bbab6e82fcee3e73bb8353c4d06 Mon Sep 17 00:00:00 2001 From: bananabas Date: Mon, 13 Apr 2026 19:14:39 +0100 Subject: [PATCH] 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. --- apps/api/app/api/auth/[...all]/route.ts | 9 ++------- .../index/db/v13/p83063--1accd9/lock.mdb | Bin 8256 -> 8256 bytes 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/api/app/api/auth/[...all]/route.ts b/apps/api/app/api/auth/[...all]/route.ts index 11eaaf9..f820801 100644 --- a/apps/api/app/api/auth/[...all]/route.ts +++ b/apps/api/app/api/auth/[...all]/route.ts @@ -1,9 +1,4 @@ import { auth } from '@/lib/auth'; +import { toNextJsHandler } from 'better-auth/next-js'; -const handler = auth.handler; - -export const GET = handler; -export const POST = handler; -export const PATCH = handler; -export const PUT = handler; -export const DELETE = handler; +export const { GET, POST, PUT, PATCH, DELETE } = toNextJsHandler(auth); diff --git a/apps/ios/.build/index-build/arm64-apple-macosx/debug/index/db/v13/p83063--1accd9/lock.mdb b/apps/ios/.build/index-build/arm64-apple-macosx/debug/index/db/v13/p83063--1accd9/lock.mdb index cc08e096d8fc60759e9b209649d4229afd7cdbdb..ffcd925974ac4c85b191a1804a17fd554a63feb9 100644 GIT binary patch delta 64 zcmX@$aKJ(E-hub~m=qNorlRFqKCO0q&P7Y+u2hl7Bm-87XFJ#mPb3WY8 LXWYDyF