how handle refresh token service in AWS amplify-js

前端 未结 5 1511
终归单人心
终归单人心 2021-01-03 16:14

In my react project I am using AWS Cognito user pool for user management, for user authentication, I am using AWS Cognito idToken. after 90min the session will expire, then

5条回答
  •  余生分开走
    2021-01-03 16:58

    Amplify will automatically keep the session fresh so long as it's active (i.e. the user is making api calls, etc.).

    If you want to force the session to stay active, even though they are not actively using your API, then the easiest thing to do would be to call Auth.currentAuthenticatedUser() at regular intervals.

提交回复
热议问题