sync
This commit is contained in:
18
app/api/auth/logout/route.ts
Normal file
18
app/api/auth/logout/route.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
|
||||
// POST /api/auth/logout - Logout and clear session
|
||||
export async function POST() {
|
||||
const response = NextResponse.json({ success: true }, { status: 200 })
|
||||
|
||||
// Clear the session cookie
|
||||
response.cookies.set('buyer_id', '', {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
sameSite: 'lax',
|
||||
maxAge: 0,
|
||||
path: '/',
|
||||
})
|
||||
|
||||
return response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user