Hi @arundas.tc,
When refreshing tokens, you need to ensure that the session is updated to extend the session. You can do this by including the refresh: true
parameter.
For example:
export default async function MyHandler(req, res) {
const accessToken = await getAccessToken(req, res, {
refresh: true,
afterRefresh,
});
};
(Reference: AccessTokenRequest | @auth0/nextjs-auth0)
Let me know how this goes for you.
Thanks,
Rueben