My React App uses AWS Cognito to create users in User Pool but currently after successful authorization session has endless lifetime. Now I need to implement checking session via Cognito Refresh Token.
On the server side (Nest.js) I'm using 'amazon-cognito-identity-js'. Once user is created successfully they performs Sign In flow via email/password and MFA code. Cognito Service returns accessToken, refreshToken and idToken but I have no idia how to handle it on the Client side. What should React app do to check is the token is valid and keep session alive? Please advice!