refresh token guide needed
i would like to know how can i refresh the jwt token in client component in nextjs, does it work in server component only?, i mean if some feature or properties are changed then they are reflected in new token right?, so how do i refreshtoken without the need of logout and login, i searched some more docs, and got something related to this on your issues in github, i think this is what i am looking for : https://github.com/kinde-oss/kinde-auth-nextjs/pull/254, but i not able to understand it, can u help me out here, also does this work for properties i defined in my kinde account, like one is isProfileComplete, so on basis of this i want to redirect user, and in backend i am thinking of using a middleware to protect my routes but for that i need the updated refreshtoken, can u help me out here?
GitHub
Fix/refresh token app router by DanielRivers · Pull Request #254 · ...
Explain your changes
This PR includes a significant improvement to token refreshing. Tokens now refresh seamlessly behind-the-scenes, providing users with the best possible experience.
In order to ...
6 Replies
Hi @kishan_6969 let me know if this doc helps. It's not Next.JS specific, but covers what you are asking about I believe. https://docs.kinde.com/authenticate/manage-authentication/sync-with-kinde/
Kinde docs
Keep your product in sync with Kinde
Our developer tools provide everything you need to get started with Kinde.
Also this thread might give you some more information, including some comments from Oli (Kinde's Product Manager) https://discord.com/channels/1070212618549219328/1320557296593403904
i didnt get this one - https://docs.kinde.com/authenticate/manage-authentication/sync-with-kinde/
i read more of documentation, so in client components i did something like this , but when i click the button to refresh the token it still gives same result of the property , is there something i missed or do i need to wait for some updates?
Kinde docs
Keep your product in sync with Kinde
Our developer tools provide everything you need to get started with Kinde.
I'll try to get someone to have a look into it for you. Thanks for your patience.
Hi @kishan_6969 I think the issue you have is one we are fixing in the new release of the NextJS SDK. The new version (see the PR here https://github.com/kinde-oss/kinde-auth-nextjs/pull/254) will include easier and more seamless token refresh. We are on a code freeze right now, but will be releasing the new version later this week or early next week latest.
If you can wait, the new version shouls solve this issue.
@CB_Kinde Thanks for the update and the PR link. I'll wait for the new release to resolve the issue.
Hi @kishan_6969, could you please give @kinde-oss/[email protected] a go please? Its near final version of the next version of the SDK which has better reworked token refresh.