Credentials provider: request headers undefined in authorize callback on new Nodes #2612
Labels
enhancement
New feature or request
good first issue
Good issue to take for first time contributors
stale
Did not receive any activity for 60 days
upstream
The issue dervies from one of next-auth dependencies
Description 馃悳
When using Credentials provider, the authorize callback should receive the incoming message object as the second parameter. However, on certain Node versions the incoming message has
undefined
asheaders
.This happens on Node versions 14.15.2, >=15.1 and >=16.0 and is related to this change: nodejs/node#35281 There is an issue on Node but it is closed (nodejs/node#36550)
A developer seems to be advising against using the spread operator on
headers
(nodejs/node#36550 (comment)) which is exactly what NextAuth is doing before callingauthorize
callback (next-auth/src/server/routes/callback.js
Line 339 in 0fae0c7
Is this a bug in your own project?
No
How to reproduce 鈽曪笍
Screenshots / Logs 馃摻
No response
Environment 馃枼
Contributing 馃檶馃徑
No, I am afraid I cannot help regarding this
The text was updated successfully, but these errors were encountered: