db(couchdb): auto-provision databases on startup for production strategy; add TokenService with CouchDB-backed token storage and localStorage fallback; switch OAuth to unified config for client IDs and redirect URI; express Request typing for req.user; align exportAsEnvVars with show-config expectations; remove Vite importmap from index.html; prefer babel-jest over ts-jest; remove duplicate uuid mocking from Jest config

This commit is contained in:
William Valentin
2025-09-09 12:30:38 -07:00
parent 062e0973c1
commit 15170a4f43
17 changed files with 1097 additions and 67 deletions

28
types/express.d.ts vendored Normal file
View File

@@ -0,0 +1,28 @@
/**
* Express Request type augmentation
*
* Adds a `user` property to `Express.Request` to store authenticated user
* information attached by authentication middleware.
*
* The `user` shape is flexible to accommodate different token verification
* outputs. When using our JWT-based middleware, it will typically match
* `TokenPayload`, but we also allow `string` or a generic record for
* compatibility with other strategies.
*/
import type { TokenPayload } from '../services/auth/auth.types';
declare global {
namespace Express {
interface Request {
/**
* Authenticated user payload attached by middleware.
* - Usually matches TokenPayload in this project.
* - May be a string or a generic object when using different verifiers.
*/
user?: TokenPayload | string | Record<string, unknown>;
}
}
}
export {};