(feur)
This commit is contained in:
parent
60133a4a08
commit
c70202e5d1
6 changed files with 117 additions and 8 deletions
|
@ -2,16 +2,14 @@ import { useSignal } from "@preact/signals";
|
|||
import Counter from "../islands/Counter.tsx";
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { getCookies } from "$std/http/cookie.ts";
|
||||
import { User } from "../storage/models/User.ts";
|
||||
|
||||
interface Data {
|
||||
user: User;
|
||||
}
|
||||
import { db, User } from "../storage/store.ts";
|
||||
import { auth } from "../auth/auth.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
GET(req, ctx) {
|
||||
const cookies = getCookies(req.headers);
|
||||
return ctx.render!({ allowed: cookies.auth === "bar" });
|
||||
const user = get_session_user(cookies);
|
||||
return ctx.render!({ user });
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue