Do you want to request a feature or report a bug?
question
What is the current behavior?
Hi, I just wanted to know how I'm supposed to handle the expiration of the refresh token, there is no clear doc about it, there is no playlod containg the info about the expiration as the others tokens ( see below)

Thanks
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.
What is the expected behavior?
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.
he already answerd to my question on the chat so I'm closing this question
Mark this a enhancement of the documentation to provide and example to handle refresh token expiration case.
I am also interested in this topic. @Jasminou, @powerful23 Could you please answer this question here as well, until the documentation is updated?
@Ligia-Andreica , here is the answer of @powerful23 on the chat:
"... for now we don't have an example for that case. We will put that in our backlog.
As a workaround you can log user our when catching an error from Auth.currentSession()
we will mark this case in documentation in the future. You may try Auth.currentSession().catch(e => // log user out here); "
This is how I solved the problem. The function takes the payload.exp and compares it to current time.
checkTokenExpiration = expiration => {
const currentUnixTime = new Date().getTime() / 1000
if (currentUnixTime > expiration) {
console.log("the token is expired!")
}
else {
console.log("the token is valid")
}
};
@powerful23 Have you provided any documentation for this issue? Because I am facing the same issue. I want to validate the refreshToken, so please give me your input.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is the documentation we have on this. Resolving
Most helpful comment
@Ligia-Andreica , here is the answer of @powerful23 on the chat:
"... for now we don't have an example for that case. We will put that in our backlog.
As a workaround you can log user our when catching an error from Auth.currentSession()
we will mark this case in documentation in the future. You may try Auth.currentSession().catch(e => // log user out here); "