login to next backend

This commit is contained in:
2026-04-18 23:45:46 +01:00
parent 2131a34e33
commit 174febe986
7 changed files with 139 additions and 80 deletions
+16
View File
@@ -0,0 +1,16 @@
import { NextResponse } from "next/server";
export async function POST(req: Request) {
const { token } = await req.json();
const res = NextResponse.json({ ok: true });
res.cookies.set("auth_token", token, {
httpOnly: true,
secure: true,
sameSite: "lax",
path: "/",
});
return res;
}