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