Skip to content
Discussion options

You must be logged in to vote

So if I understand correctly, you have the app with NextAuth.js (A), and another one (B).

  1. Click sign-in on B
  2. Redirect to A that has a cookie.
  3. Redirecting to... Homepage on A?
  4. User clicks sign-in on A (with Credentials Provider)
  5. Shows sign-in page on A, the user clicks again, (no credentials needed)
  6. authorize callback verifies the cookie and returns the user.

And you want to skip 4 and 5.

It almost sounds like NextAuth.js has no place in this flow. You could create an API route that is similar to what our /api/auth/session endpoint does, basically checking the cookie, if it's valid it returns it with an updated expiry, otherwise returns nothing.

NextAuth.js manages (creates/updates/delet…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ismatim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
2 participants
Converted from issue

This discussion was converted from issue #3881 on February 08, 2022 12:03.