Skip to content

Commit

Permalink
fix: detect origin when instanceof Request check fails (#7303)
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 authored Apr 18, 2023
1 parent e97b274 commit 6f9ca41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next-auth/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ async function toInternalRequest(
query,
}
}

const { headers } = req
const host = headers?.["x-forwarded-host"] ?? headers?.host
req.origin = detectOrigin(host, headers?.["x-forwarded-proto"])

return req
}

Expand Down

1 comment on commit 6f9ca41

@vercel
Copy link

@vercel vercel bot commented on 6f9ca41 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.