Files
ocs-portal-web/app/api/logout/route.ts
2025-04-15 13:56:54 +07:00

19 lines
466 B
TypeScript

import { cookies } from 'next/headers';
import { NextResponse } from 'next/server';
export const POST = async () => {
// Hapus cookie 'credential'
cookies().delete({
name: "credential",
httpOnly: false,
sameSite: 'strict',
path: '/',
maxAge: 0,
})
// Return a JSON response
return NextResponse.json({
message: 'Cookie deleted successfully.',
status: 'success',
}, { status: 200 });
};