ls-deno/routes/logout.tsx

21 lines
542 B
TypeScript

import { Handlers } from "$fresh/server.ts";
// 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 (
<p>
If you were logged in before, we've logged you out.
</p>
);
}