Providers Issue: "State cookie was missing" ? (NextAuth 4.22.1) #7403
Unanswered
OatsProgramming
asked this question in
Help
Replies: 1 comment
-
same problem here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Disclaimer: I'm still relatively new to auth; I usually just use Firebase SDK)
Before starting, I should say that I'm using the app directory and placed the auth api in a NextJS 13 Route Handler.
Credentials work perfectly fine, but as for other providers (i.e. Google and Github for my case) I'd get the following error:
ERROR no.1
It does redirect the user to auth server. The issue is that once they've "signed in" and come back to the original site, it would give that error. So I tried to add a cookies config to my authOptions after one topic i found ( #6898 ):
ATTEMPT no.1
Which resulted to a somewhat similar error but this time: PKCE code_verifier cookie was missing.
ERROR no.2
That topic is considered answered but it doesn't solve the problem for my scenario.
I've looked at the docs for answers and I'd only find it telling me that to make sure that pkceCodeVerifier is set up properly, which was what I was attempting to do.
Then I thought it was perhaps my environment variables; so, I've updated them. Still the same issue.
Does anyone have the answer for this?
Here are my dependencies:
My config ( might look different since it's in a Route Handler rather than a regular API Route ):
Beta Was this translation helpful? Give feedback.
All reactions