Compare commits

...

1 Commits

Author SHA1 Message Date
David Colón
63171a0271 fix: validate provider existence before looking for protection property (#1687)
* Fix validation of provider existence before looking for protection property

* Use optional chaining
2021-04-11 15:20:01 +02:00

View File

@@ -79,7 +79,7 @@ async function NextAuthHandler (req, res, userOptions) {
provider.protection = 'state' // Default to state, as we did in 3.1 REVIEW: should we use "pkce" or "none" as default?
}
if (typeof provider.protection === 'string') {
if (typeof provider?.protection === 'string') {
provider.protection = [provider.protection]
}