WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto

feat(web): type auth and mod route factories with WebAppEnv (ATB-53)

+4 -2
+2 -1
apps/web/src/routes/auth.ts
··· 1 1 import { Hono } from "hono"; 2 2 import { logger } from "../lib/logger.js"; 3 + import type { WebAppEnv } from "../lib/theme-resolution.js"; 3 4 4 5 /** 5 6 * POST /logout → calls AppView logout, clears cookie, redirects to / 6 7 */ 7 8 export function createAuthRoutes(appviewUrl: string) { 8 - return new Hono() 9 + return new Hono<WebAppEnv>() 9 10 /** 10 11 * POST /logout — logout should be a POST (not a link) to prevent CSRF. 11 12 *
+2 -1
apps/web/src/routes/mod.ts
··· 1 1 import { Hono } from "hono"; 2 2 import { isProgrammingError } from "../lib/errors.js"; 3 3 import { logger } from "../lib/logger.js"; 4 + import type { WebAppEnv } from "../lib/theme-resolution.js"; 4 5 5 6 /** 6 7 * Single proxy endpoint for all moderation actions. ··· 18 19 * unban → DELETE /api/mod/ban/:id body: { reason } 19 20 */ 20 21 export function createModActionRoute(appviewUrl: string) { 21 - return new Hono().post("/mod/action", async (c) => { 22 + return new Hono<WebAppEnv>().post("/mod/action", async (c) => { 22 23 let body: Record<string, string | File>; 23 24 try { 24 25 body = await c.req.parseBody();