Skip to content

Commit

Permalink
fix: express adapter build errors from response status
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonraimondi committed Aug 12, 2024
1 parent 3c195ae commit f8f09c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/adapters/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f8f09c8

Please sign in to comment.