2024-06-21 11:36:23 +02:00
|
|
|
import { deleteCookie } from "@std/http/cookie";
|
2023-08-04 22:35:25 +02:00
|
|
|
import { Handlers } from "$fresh/server.ts";
|
|
|
|
|
|
|
|
export const handler: Handlers = {
|
2023-08-09 15:58:36 +02:00
|
|
|
GET(req) {
|
|
|
|
const url = new URL(req.url);
|
|
|
|
|
|
|
|
const redirect = decodeURIComponent(url.searchParams.get("redirect") || "");
|
|
|
|
|
2023-08-04 22:35:25 +02:00
|
|
|
const headers = new Headers();
|
2023-08-09 15:58:36 +02:00
|
|
|
headers.append("location", redirect || "/");
|
|
|
|
|
2023-08-04 22:35:25 +02:00
|
|
|
deleteCookie(headers, "session_cookie", {
|
|
|
|
path: "/",
|
|
|
|
});
|
|
|
|
|
|
|
|
return new Response(null, {
|
|
|
|
headers,
|
|
|
|
status: 302,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|