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
This commit is contained in:
23
app/api/merchants/logout/route.ts
Normal file
23
app/api/merchants/logout/route.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user