I am using fusionauth in my Next Js application.
In my API, I am checking If the access token is expired or not. If the token is expired, I am generating a new token based on the refresh token.
Sometimes I am facing that while renewing access token I am getting 400 so that means refresh token is expired and my API got failed and user redirected to home page suddenly.
What I would like to check is, whenever the application gets loaded at that time check If a refresh token is valid for the next 24 hours or not. If expired then redirect to the home page else user can visit the requested page.
Thanks a lot in advance!