Renewing authToken under secure mode with Amity-Social-Cloud-UIKit-Web-OpenSource

In Amity-Social-Cloud-UIKit-Web-OpenSource, how do I keep the users logged in under secure mode?

According to Security - Amity Docs and stuff, I see the process is something like

  1. frontend asks our application server for an authentication token
  2. our application server calls POST /api/v4/authentication/token and send the token back to frontend
  3. frontend passes that authentication token to <AmityUiKitProvider authToken={...} />

Then, how do we keep that user logged in? like:

  • does the <AmityUiKitProvider /> automatically renew the authToken internally without us having to do anything
  • or, do we need to take care of token renewal by ourselves
    • I see token renewal things here, and I’m assuming we gotta pass SessionHandler to sdk client, how do we do this with <AmityUiKitProvider />, seems like the client is initialized inside the Provider and I couldn’t find any props seeming relevant.

Would be great if there’s a sample code covers all these.

Hello, you will have to recall login again when user is logged out, there isn’t a function/approach to keep the logged in.

Regarding the renewal process, it should be handled within your backend and is not accessible via the AmityUiKitProvider.