-
Notifications
You must be signed in to change notification settings - Fork 165
Description
Expected behavior
When we call Intercom.instance.setUserJwt(newJwtToken) with a new JWT (e.g. after token refresh or re-login), we expect Intercom to update the logged-in user's JWT-protected attributes (e.g. name, email from the JWT payload) so that the Intercom profile stays in sync with the new token.
Actual behavior
After calling only setUserJwt(newJwtToken):
- The new JWT is accepted (e.g. identity verification works with the new token).
- User attributes that are protected by JWT (name, email, etc.) are not updated on the Intercom side; they retain the previous values.
To get the profile to match the new JWT we have to:
- Call
Intercom.instance.updateUser(name: ..., email: ...)with those values.
So "updating the JWT" alone is not enough to refresh JWT-protected attributes; an explicit updateUser() call is required.
Steps to reproduce
- Log in a user and set an initial JWT:
Intercom.instance.setUserJwt(initialToken)with initial name - Obtain a new JWT (e.g. refresh or new login) whose payload has updated name (or other JWT-protected attributes).
- Call only
Intercom.instance.setUserJwt(newToken)— do not callupdateUser(). - Check the user in Intercom (e.g. via dashboard or
fetchLoggedInUserAttributes()).
Result: JWT is updated but name still show the old values.
Workaround
After each setUserJwt(newToken), decode the JWT payload and call Intercom.instance.updateUser(...) with the desired attributes (e.g. name) so the profile matches the new token.
Question
Is it intended that setUserJwt() only updates the token and does not trigger a sync of JWT-protected user attributes?
Environment
- Package:
intercom_flutter(9.4.22) - Platform: iOS / Android (or both)