17 lines
432 B
TypeScript
17 lines
432 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import { clearAdminSession } from '@/lib/admin-auth'
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
await clearAdminSession()
|
|
return NextResponse.json({ success: true })
|
|
} catch (error) {
|
|
console.error('Error during admin logout:', error)
|
|
return NextResponse.json(
|
|
{ error: 'Failed to process logout' },
|
|
{ status: 500 }
|
|
)
|
|
}
|
|
}
|
|
|