ls-deno/routes/logout.tsx

24 lines
616 B
TypeScript
Raw Normal View History

2022-10-08 02:01:48 -05:00
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>
);
}