Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

What should you do when the refresh token expires after 30 days? #183

Open
kocur4d opened this issue Feb 25, 2019 · 1 comment
Open

What should you do when the refresh token expires after 30 days? #183

kocur4d opened this issue Feb 25, 2019 · 1 comment

Comments

@kocur4d
Copy link

kocur4d commented Feb 25, 2019

The refresh token expires after 30 days, and the docs say

If the refresh token is expired, your app user must reauthenticate by signing in again to your user pool.

But how do I know in advance when this should happen?

I don't want my users to be kicked out in a middle of a day and ask them to reauthenticate because the Refresh token decided to expire now.

I would ideally like to check, every time when the page is loaded, if refresh token is getting close to expiring and then log user out and ask him to login again, but Refresh token don't have any data assigned to it indicating it expiry date.

How do you guys deal with a situation of refresh token getting expired?

@ronkot
Copy link

ronkot commented Oct 23, 2019

The refresh token expiry time is configurable option. I've set it to maximum (10 years 😅). Basically long refresh token validity time is the only way to keep users logged in for long time.

If you want to check expiry time of an issued refresh token, I think you could decode the token (it's a JWT) and read the exp claim which should contain expiry time in unix time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants