I am not sure if this issue belongs to this repo but any help is appreciated, the issue seems to happen only in Preview, running in prod and in dev is working well.
It does not allow me to access the current session information in the API side
I cloned the project and modified the file src/app/api/hello/route.ts by this way to return the current session:
import { auth } from "@/server/auth";
import type { NextRequest } from 'next/server'
export const runtime = 'edge'
export async function GET(request: NextRequest) {
const session = await auth();
return Response.json({ session });
}
When I start the project using bun run dev, and after I login and access http://localhost:3000/api/hello I can get the current session: {"session":{"user":{"name":"Esteban",....."expires":"2024-10-24T20:50:42.270Z"}}
But when I do the same starting the project using bun run preview and accessing http://localhost:8788/api/hello it always return empty: {"session":null}
I am not sure if this issue belongs to this repo but any help is appreciated, the issue seems to happen only in Preview, running in prod and in dev is working well. It does not allow me to access the current session information in the API side
I cloned the project and modified the file
src/app/api/hello/route.ts
by this way to return the current session:When I start the project using
bun run dev
, and after I login and access http://localhost:3000/api/hello I can get the current session:{"session":{"user":{"name":"Esteban",....."expires":"2024-10-24T20:50:42.270Z"}}
But when I do the same starting the project using
bun run preview
and accessing http://localhost:8788/api/hello it always return empty:{"session":null}