// lib/auth.ts — local single-user shim. // // This dashboard runs only on localhost for one person, so there is no real auth. // Every request is the same user. Routes still call requireUser(req) to keep the // kit's API shape (and to make adding real auth later a one-file change). export const LOCAL_USER_ID = "local"; export class AuthError extends Error { constructor(public status = 401, message = "Unauthorized") { super(message); } } // Always resolves to the single local user. `req` is accepted for signature // compatibility with the kit and future auth. export async function requireUser(_req?: Request): Promise { return LOCAL_USER_ID; }