revert: drop visitor CTA button and public visit endpoint
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { db, guests } from '@/lib/db';
|
||||
import { USR_COOKIE, buildCookie, isSecureCookie } from '@/lib/auth/cookies';
|
||||
|
||||
const ONE_YEAR = 60 * 60 * 24 * 365;
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const [row] = await db.insert(guests).values({ name: 'Visitante' }).returning();
|
||||
const headers = new Headers();
|
||||
headers.append('Set-Cookie', buildCookie(USR_COOKIE, row.id, isSecureCookie(request), ONE_YEAR));
|
||||
return NextResponse.json({ success: true, guestId: row.id }, { headers });
|
||||
}
|
||||
Reference in New Issue
Block a user