Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Amplify "Refresh Token has expired" after less than configured time (30 days)

I'm using React Native and Expo. Also using aws-amplify to manage users with Cognito's user pool. Every so often my users are getting kicked out of the system because of "Refresh Token has expired" error. Those users were in the system in the previous week so their refresh token should still be valid. Any ideas? I'm using: aws-amplify 2.2.0 aws-amplify-react-native 2.2.3 react-native 0.59 expo 35

like image 360
oriharel Avatar asked Oct 20 '25 03:10

oriharel


1 Answers

I think this is a misunderstanding of the docs. I was under the impression that the refresh token is being re-issued on every session, thus users should never get to the expiration time while they are active. Apparently this is not the case, as users are issued a refresh token upon login only and that token is being persistent on the client side storage. No matter if they are active or not, this token is expired after 30 days (or else configured) and then need to re-login again.

(of course I'm aware that this is not an Amplify implementation)

like image 186
oriharel Avatar answered Oct 23 '25 00:10

oriharel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!