24 lines
548 B
TypeScript
24 lines
548 B
TypeScript
import Headline from "../components/Headline.tsx";
|
|
import { define, isLoggedIn } from "../utils.ts";
|
|
|
|
export const handler = define.handlers({
|
|
GET(ctx) {
|
|
console.log("ASDF");
|
|
if (!isLoggedIn(ctx.req)) {
|
|
const url = new URL(ctx.req.url);
|
|
url.pathname = "/sign-in";
|
|
return Response.redirect(url, 303);
|
|
}
|
|
|
|
return { data: {} };
|
|
},
|
|
});
|
|
|
|
export default define.page<typeof handler>(function Dashboard(_ctx) {
|
|
return (
|
|
<div class="container mx-auto p-4">
|
|
<Headline>Dashboard</Headline>
|
|
</div>
|
|
);
|
|
});
|