question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Facebook provider not working - next-auth v4.0.0-beta.4

See original GitHub issue

Description 🐜

Seems the “state” query param is lost in between request. I did some light debugging it seems that the error originates from node-openid-client I saw that it had specific node.js requirements, but I do seem to meet them (14.18.0)

My current simple setup: Screenshot 2021-10-11 at 16 55 00

Error that I’m getting with (Debug enabled + additional logging): Screenshot 2021-10-11 at 16 58 37

Is this a bug in your own project?

No

How to reproduce ☕️

Just a simple setup as in the example. Facebook login callback setting: Screenshot 2021-10-11 at 17 03 39

Screenshots / Logs 📽

No response

Environment 🖥

System: OS: macOS 10.15.7 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 198.18 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.18.0 - ~/.nvm/versions/node/v14.18.0/bin/node Yarn: 1.22.5 - ~/.yarn/bin/yarn npm: 6.14.15 - ~/.nvm/versions/node/v14.18.0/bin/npm Browsers: Chrome: 94.0.4606.71 Edge: 94.0.992.38 Firefox: 90.0.2 Safari: 14.0 npmPackages: next: ^11.1.2 => 11.1.2 next-auth: ^4.0.0-beta.4 => 4.0.0-beta.4 react: 17.0.2 => 17.0.2

Contributing 🙌🏽

Yes, I am willing to help solve this bug in a PR

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
davidgustyscommented, Oct 11, 2021

Apparently, there was a plugin that was messing with “req.url” which then in turned caused client.callbackParams(req) to malfunction and auth flow to fail. Sorry for the bother.

1reaction
davidgustyscommented, Oct 11, 2021

Yeah, I saw #2524 which is why I doubled checked if I’ve done everything according to docs. I also tried playing around with configuration settings like checks, setting it to pkce or none, but in that case, I’m getting a 401.

As per your request @balazsorban44 , I have just checked with Safari(14.0) and Firefox (92.0), but I’m getting the same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manually Test Providers (v4) · Issue #2524 · nextauthjs/next-auth
EVEOnline provider not working in v4 .... The problem is that a Scope query parameter is being inserted in the URL which EVE...
Read more >
Upgrade Guide (v4) - NextAuth.js
NextAuth.js version 4 includes a few breaking changes from the last major version (3.x). So we're here to help you upgrade your applications ......
Read more >
Next Auth getSession API call fails randomly on production
I've made sure to set my NEXTAUTH_URL environment variable on Vercel. And fetching the user session does work some of the time. But...
Read more >
there is a problem with the server configuration. nextauth
I used google as an auth provider with next auth. Configured all the the environment variables both in production and development. It's working...
Read more >
Nextauth Complete Tutorial #12 Add Facebook provider
Source code:https://www.youtube.com/channel/UCu4-4FnutvSHVo9WHvq80Ww/join You can also subscribe or follow to get info or our (free) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found