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:
28
types/express.d.ts
vendored
Normal file
28
types/express.d.ts
vendored
Normal 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 {};
|
||||
Reference in New Issue
Block a user