6989a98d75
- Arkitektur: docs/auth/passwordless-architecture.md - Backend: iom/quixzoom-auth-service/ (FastAPI + Redis) - Webb: quixzoom-market-pages/se/login/ (QR-kod + polling) - App: iom/quixzoom-app/src/features/auth/ (push + deep links) Flöde: QR-kod → app-godkännande → webb-inloggad
23 lines
738 B
TypeScript
23 lines
738 B
TypeScript
import type * as http from 'node:http';
|
|
export type BodyParserLikeRequest = http.IncomingMessage & {
|
|
body?: any;
|
|
};
|
|
/**
|
|
* Fix proxied body if bodyParser is involved.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* createProxyMiddleware({
|
|
* target: 'http://example.com',
|
|
* on: {
|
|
* proxyReq: fixRequestBody,
|
|
* }
|
|
* });
|
|
* ```
|
|
*
|
|
* Alternative solution without using `fixRequestBody()`: put `http-proxy-middleware` before `bodyParser` in the middleware stack.
|
|
*
|
|
* @see {@link https://github.com/chimurai/http-proxy-middleware/issues/40 Github issue #40 - POST request body is not proxied}
|
|
*/
|
|
export declare function fixRequestBody<TReq extends BodyParserLikeRequest = BodyParserLikeRequest>(proxyReq: http.ClientRequest, req: TReq): void;
|