Files
Pay2Gateway/app/api/merchants/logout/route.ts
mstfyldz 3562e10713 feat: implement merchant dashboard, secure auth, and short_id system
- Added dedicated merchant dashboard with analytics and transactions
- Implemented API Key based authentication for merchants
- Introduced 8-character Short IDs for merchants to use in URLs
- Refactored checkout and payment intent APIs to support multi-gateway
- Enhanced Landing Page with Merchant Portal access and marketing copy
- Fixed Next.js 15 async params build issues
- Updated internal branding to P2CGateway
- Added AyrisTech credits to footer
2026-01-20 21:58:41 +03:00

24 lines
937 B
TypeScript

import { NextRequest, NextResponse } from 'next/server';
import { cookies } from 'next/headers';
export async function POST(req: NextRequest) {
try {
const { identifier } = await req.json();
const cookieStore = await cookies();
// We don't know the exact UUID easily if they provide a short_id,
// but we can try to clear both or just clear the one we know.
// Actually, since we set it for both in the auth route, let's clear common ones.
// A better way: clear all cookies starting with merchant_auth_
// But Next.js cookies API doesn't support listing/clearing by pattern easily.
// So we'll just clear the one for the provided identifier.
cookieStore.delete(`merchant_auth_${identifier}`);
return NextResponse.json({ success: true });
} catch (err: any) {
return NextResponse.json({ error: err.message }, { status: 500 });
}
}