-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3.14.0
bug: TypeError: [provider.protection].flat is not a function
#1675
Comments
thanks, I think you are right! A PR is very welcome for this as it should be an easy fix, but if no one volunteers, I'll just do it myself. 🙂 |
@balazsorban44 I can, but what about this case where Line 79 in dbe283f
Should that be an array? The documentation is not super clear on what types |
Originally it was supposed to be a string, but later I was told it would be great if it did support different methods of protection, like PKCE AND state for example (there is also nonce, which isn't implemented right now). For that not to be a breaking change, we still support both a string and an array of strings. I guess it would be nice if in the core, we just used an array everywhere, so changing that line to ["state"] would be fine. |
A provisional solution until we wait for the pull request, use node 11 or higher for Array.prototype.flat to be available 😜 |
see if this can be fixed in this version #1684 |
🎉 This issue has been resolved in version 3.14.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 3.14.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 4.0.0-next.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
provider.protection
is not a required property, and not providing it breaks the package since.flat()
is called without first verifying it is an array.Steps to reproduce
Add a custom provider without specifying
protection
propertyAdditional context
Here are all the places this is done:
https://github.com/nextauthjs/next-auth/search?q=%5Bprovider.protection%5D.flat%28%29
The text was updated successfully, but these errors were encountered: