Session issues on UI Kit 3.0?

Hey, after upgrading the UI Kit 3.0 I see some issues in my application. I haven’t changed anything else only upgrading the UI Kit to 3.0.

I have integrated like this:

<AmityUiKitProvider
            key={userId}
            apiKey={apiKey}
            apiRegion={apiRegion}
            userId={userId}
            displayName={displayName}
            authToken={amityAuthToken}
          >
            <AmityUiKitSocial />
          </AmityUiKitProvider>

before rendering the component I have a server side request to get the token that can be used to request a session which works when I do the login from my app but inside the <UIKitProvider> it seems the authToken is not used anymore by the component and the session calls inside the UIKitProvider fails.

See some screenshots:

This call I assume is when I do the login:

Client.login(
        {
          userId: userId,
          displayName: displayName,
          authToken: authToken,
        },
        amitySessionHandler

as you can see I’m passing the authToken which is visible in call and the request is successful, I receive an accessToken

after this the UIKitSocial component is rendered that does again a session call but in this case the authToken is not passed even though I have passed this authToken to the UIKitProvider (see code above)

and it fails with:

Further investigating the source code of the UIKitProvider

I don’t see where the Provider uses the authToken that is passed to the component? If you do a search for “authToken” in this file you will see that it finds it only once in the interface definition.

Shouldn’t this be used in the login and/or createClient call line 86 and 97, and is this the reason the session call fails?

Thanks,
Lorand

I think this is a bug as I have changed the source code with this:

and the session issue is gone now…

Hello @lorandd thank you for bringing this to our attention. We’ll review this with our team.

Hey guys, its been a month since last reply, can you confirm this is a bug in the UI Kit?
Basically the UI Kit is unusable in secure mode in its current state as it doesn’t handle the authToken ?

Hello @lorandd, apologies for not updating you here, as we’ve already provided the updates via email that we escalated this issue to the team.

Since you’ve found and applied the solution in your UIKit, we recommend keeping this code for now until the fix version is released. If you encounter any issues with this solution, please let us know. Thank you. :pray: :slight_smile:

ok, but since this is not in the UIKit this doesn’t seems to be tested hence issues like:

We will emphasize this with the team to ensure that the issues are resolved on both the UIKit and SDK. Thank you for bringing this to our attention :slight_smile:

This change is now added to the latest version v3.2.2 but it doesn’t fix the session issue:

1 Like