captcha
captcha copied to clipboard
Forward ClientRecord from middleware in express
Client record is retrieved in domainMiddleware.
Express Request object should be extended to have req.clientRecord as a key so that we don't need to query for clientRecord multiple times.
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d757e7089fe724d90d85813c1a2ea2e437a13604/types/express-serve-static-core/index.d.ts#L6-L13
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/method-override/index.d.ts
https://expressjs.com/en/guide/writing-middleware.html
https://stackoverflow.com/a/47448486
- [ ] Do we use a cache object and pass a state around
- [ ] Modify the express request first