import { Handlers } from "$fresh/server.ts";
import { Page } from "@/components/Page.tsx";
// import { getToken, getUser } from "@/db/mod.ts";
// import * as base64 from "$std/encoding/base64.ts";
import { deleteCookie } from "$std/http/cookie.ts";

export const handler: Handlers<unknown> = {
  async GET(request: Request, context) {
    const response = await context.render();
    deleteCookie(response.headers, "lsauth");
    return response;
  },
};

export default function LoggedOut() {
  return (
    <Page>
      <p>
        If you were logged in before, we've logged you out.
      </p>
    </Page>
  );
}
