Inject external API result or payload into NextAuth session #36000
Unanswered
archercoder
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am using NextAuth Credential Provider for login to the site. Everything is working fine for Login process.
Our site's user data is stored on external db which communicate thru API. Due to the mechanism of the External API, the registration process require the site to create session once user submit the form. The result or payload returned by the external API will consist of user information including the token to communicate with the external API.
I see the NextAuth document using authorize() method to create a session. My question is, can I create a session without running the authorized() method? I am thinking to inject the payload result from the external API into the session. I need to create a session because I need to get the token from the session that will be used for subsequence pages once the form is submitted.
For short , my question is, may I know if it is possible to inject or add a payload or result returned by external API into the session using NextAuth?
Beta Was this translation helpful? Give feedback.
All reactions