Replies: 1 comment
-
@snax4a I'm also trying to use next-auth with an existing api and hit this wall. |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am a bit confused about the CredentialsProvider use case.
I have my custom API with a /get-token endpoint which i want use for credentials authentication.
If correct credentials are provided it returns this kind of response:
I decided to use next-auth credentials provider and I am hitting this endpoint from the authorize method and returning these tokens as a user.
But in all the tutorials and examples I see that authorize method is used to return user object and If I understand correctly the JWT is generated by the next-auth.
Is It possible to use next-auth and disable JWT generation on next-auth but generate the JWT on the external API and only store it in the next-auth session?
In the JWT I have user details encrypted so I can return them also from authorize but I wonder if its necessary If I want next-auth to only hold my tokens but the user profile I can fetch with react-query.
How can I disable next-auth jwt encode and decode methods as I want to use the token returned from the API?
Unfortunately, I could not find any similar next-auth example with react-query
Beta Was this translation helpful? Give feedback.
All reactions