@intuitionrobotics/thunderstorm
Version:
28 lines • 901 B
TypeScript
/**
* Adds `req.account` to Express's `Request`, populated by `makeRequireAuth`.
*
* `AuthAccount` is intentionally EMPTY here so CONSUMERS widen it via
* declaration merging to their real account shape, e.g. in ir-q-support:
*
* declare global { namespace Express { interface AuthAccount {
* _id: string;
* email: string;
* } } }
*
* (A single `account` property can't be re-typed by two declarations, but an
* open interface merges cleanly across the framework and each consumer.)
*
* Side-effect-imported from `backend.ts` so the global merge loads transitively
* for consumers — without that, `req.account` silently degrades to `any`.
*/
declare global {
namespace Express {
interface AuthAccount {
}
interface Request {
account?: AuthAccount;
}
}
}
export {};
//# sourceMappingURL=express-augmentation.d.ts.map