16 lines
554 B
TypeScript
16 lines
554 B
TypeScript
/**
|
|
* Hono `ContextVariableMap` augmentation — declares the `user` and
|
|
* `session` slots populated by `sessionMiddleware`. Sibling plugins
|
|
* read `c.get("user")` typed as `Principal | null` thanks to this
|
|
* declaration; without it the value would type as `unknown`.
|
|
*/
|
|
import type { Principal } from "../principal/principal.js";
|
|
import type { BetterAuthSessionResult } from "../services/auth-service.js";
|
|
|
|
declare module "hono" {
|
|
interface ContextVariableMap {
|
|
user: Principal | null;
|
|
session: BetterAuthSessionResult;
|
|
}
|
|
}
|