From f8f09c8bf27180e75dce95194d1c70d2b5cd9ff9 Mon Sep 17 00:00:00 2001 From: Jason Raimondi Date: Mon, 12 Aug 2024 18:13:25 -0400 Subject: [PATCH] fix: express adapter build errors from response status --- src/adapters/express.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adapters/express.ts b/src/adapters/express.ts index c5482d0e..a1073a92 100644 --- a/src/adapters/express.ts +++ b/src/adapters/express.ts @@ -5,8 +5,8 @@ import { OAuthRequest } from "../requests/request.js"; import { OAuthResponse } from "../responses/response.js"; import { isOAuthError } from "../utils/errors.js"; -export function responseFromExpress(res: Response): OAuthResponse { - return new OAuthResponse(res); +export function responseFromExpress({ status, ...res }: Response): OAuthResponse { + return new OAuthResponse({ status: res.statusCode ?? 200, ...res }); } export function requestFromExpress(req: Request): OAuthRequest {