From 19959a0325b99774d5bfc211d78c6bbe79cc7835 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 25 Jan 2026 18:20:57 -0600 Subject: [PATCH] . --- express/basic/routes.ts | 10 +++++++++- templates/basic/home.html.njk | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/express/basic/routes.ts b/express/basic/routes.ts index e042c43..63bf96a 100644 --- a/express/basic/routes.ts +++ b/express/basic/routes.ts @@ -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 = { 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, diff --git a/templates/basic/home.html.njk b/templates/basic/home.html.njk index e9608cf..c23abfd 100644 --- a/templates/basic/home.html.njk +++ b/templates/basic/home.html.njk @@ -5,8 +5,7 @@ home

- - {{ email }} + {{ name }} - {{ email }}

{% if showLogin %} login