In my application I have used aws cognito
with next auth
for user auth.
In the jwt callback
that I have from api next-auth I receive an access token, which is then saved and sent to the client side. There, I save it in local storage and, among other things, I send it to my api which checks if it is correct.
The problem is that after an hour the access token expires and does not get a new one (always next-auth gives me old value). Has anyone had a similar flow and knows how to manage a session refresh? I will add that I am not automatically logged out because next-auth
is managing it underneath, but it does not return the value of the new access token to me.
Do you have any ways how to manage this?