ls-deno/routes/logout.tsx

21 lines
542 B
TypeScript
Raw Normal View History

2022-10-08 02:01:48 -05:00
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> = {
2022-10-11 23:49:36 -05:00
async GET(_request: Request, context) {
2022-10-08 02:01:48 -05:00
const response = await context.render();
deleteCookie(response.headers, "lsauth");
return response;
},
};
export default function LoggedOut() {
return (
2022-10-11 23:49:36 -05:00
<p>
If you were logged in before, we've logged you out.
</p>
2022-10-08 02:01:48 -05:00
);
}