- Implemented Prisma schema with models for AdminUser, AppSettings, and Snapshot. - Created seed script to initialize the database with an admin user and JWT secret. - Developed admin login page with form handling and error management. - Added API routes for admin login, logout, change password, and JWT verification. - Integrated Stripe for payment intent management in admin orders. - Established middleware for protecting admin routes with JWT authentication. - Created Zustand stores for managing persona and snapshot states.
14 lines
339 B
TypeScript
14 lines
339 B
TypeScript
import { NextResponse } from 'next/server';
|
|
|
|
export async function POST() {
|
|
const response = NextResponse.json({ success: true });
|
|
response.cookies.set('admin_token', '', {
|
|
httpOnly: true,
|
|
secure: process.env.NODE_ENV === 'production',
|
|
sameSite: 'lax',
|
|
maxAge: 0,
|
|
path: '/',
|
|
});
|
|
return response;
|
|
}
|