After Google sign in with custom Postgres adapter I'm still unauthenticated #5832
Unanswered
craig-bowers
asked this question in
Help
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question 💬
I used this as a starting point to set up my NextAuth Postgres adapter, but I made a few changes to use pg-promise instead of pg and JavaScript instead of TS.
I am running into an issue though. When I use my custom adapter and try signing into the site via GoogleProvider I'm getting a new database entry into each of my users, accounts, and sessions tables. However, the next-auth.session-token cookie is not getting set when I'm redirected back to http://localhost:3000 and when I try using useSession() on the front-end the status says I'm unauthenticated.
When I bypass the adapter it lets me log in just fine, the next-auth.session-token cookie is set, and I can use useSession() to see my Google email, image, etc., and it tells me that I'm authenticated. Obviously none of the data makes its way into Postgres with it bypassed though.
// adapter: PostgresAdapter(db),
Any idea on what the problem might be?
How to reproduce ☕️
[...nextauth].js
adapter.js
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions