Authenticating User Server-site for Refresh Token #5304
Unanswered
aperalta1437
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
Hello everyone! I am using Next-Auth for a front-end Next.js application that utilizes a Spring boot back-end application. I am building both apps. I use the credentials provider to authenticate the user in the front-end; however, I would like to implement a refresh token and I've finished the implementation in my Spring boot API but in order to have the new access token saved onto the session I need to authenticate the user again so that the callbacks are triggered with the information I received from the back-end. In doing so, I created another credentials provider that will receive the access and refresh token and then refresh them. In order to have a solution that works server-side as well, I need to authenticate using the next-auth REST endpoints. In my case, I would have to make the below call:
And every time I make the above call to refreshCredentials credentials provider, I always get 200 but the code in the provider never executes (I put console.log statements there to know). Is there anything that I am missing in the above call that Next-Auth requires?
How to reproduce ☕️
And for the provider:
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions