16 lines
366 B
TypeScript
16 lines
366 B
TypeScript
import { unsetAuthCookie } from "../../lib/auth.ts";
|
|
import { define } from "../../utils.ts";
|
|
|
|
export const handler = define.handlers({
|
|
POST(ctx) {
|
|
const headers = new Headers();
|
|
unsetAuthCookie(headers);
|
|
|
|
headers.set("location", new URL("/", ctx.req.url).toString());
|
|
return new Response(null, {
|
|
status: 303,
|
|
headers,
|
|
});
|
|
},
|
|
});
|