Next.js Refresh Token null
Hi! In my Next.js application i'm trying to use the refresh token method from
getKindeServerSession()
in my route handler. I have the kinde debug mode set to true
in my env variables. The problem is that i receive a null
value upon logging the value of the refresh token. And I also get an error message that says:
5 Replies
i am also attaching my code for reference
I'm having the same issue!
Hi there. Just referring this to a NextJS expert in our team. Thanks for your patience.
A few triage questions:
What version of NextJS and the SDK are you using?
Has this stopped working? Or are you setting up for first time? Can you share your backend/Frontend/Middleware setup?
Hi @readme and @agr
We have recently updated our guidance for tokens to be automatically refreshed.
https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/#set-up-the-kinde-auth-provider Is your application wrapped in the AuthProvider? if not could you adjust and try again please?
https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/#set-up-the-kinde-auth-provider Is your application wrapped in the AuthProvider? if not could you adjust and try again please?
Kinde docs
Next.js App Router SDK
Our developer tools provide everything you need to get started with Kinde.
@Daniel_Kinde sorry for the late reply. I wrapped the application and now i can see the refresh tokens. But when should i use it. I know that they must be used when the previous token gets expired but where in the application should one use it. Thank you.