.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { DateTime } from "ts-luxon";
|
||||
import { get, User } from "../framework/hydrators/user";
|
||||
import { request } from "../request";
|
||||
import { html, render } from "../request/util";
|
||||
import type { Call, Result, Route } from "../types";
|
||||
@@ -23,11 +24,18 @@ const routes: Record<string, Route> = {
|
||||
const _auth = request.auth;
|
||||
const me = request.session.getUser();
|
||||
|
||||
const email = me.toString();
|
||||
const id = me.id;
|
||||
console.log(`*** id: ${id}`);
|
||||
|
||||
const u = await get(id);
|
||||
|
||||
const email = u?.email || "anonymous@example.com";
|
||||
const name = u?.display_name || "anonymous";
|
||||
const showLogin = me.isAnonymous();
|
||||
const showLogout = !me.isAnonymous();
|
||||
|
||||
const c = await render("basic/home", {
|
||||
name,
|
||||
email,
|
||||
showLogin,
|
||||
showLogout,
|
||||
|
||||
Reference in New Issue
Block a user