fix(frontend): preserve intercomJwt through token refresh#160
Open
mlehotskylf wants to merge 2 commits into
Open
fix(frontend): preserve intercomJwt through token refresh#160mlehotskylf wants to merge 2 commits into
mlehotskylf wants to merge 2 commits into
Conversation
refresh.post.ts was rebuilding auth_user_profile without intercomJwt, causing identified Intercom sessions to silently break after token expiry. Extract it from the refreshed ID token claims alongside username. Signed-off-by: Michal Lehotsky <mlehotsky@linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
Preserves the Intercom user JWT claim in the auth_user_profile cookie when the frontend refreshes Auth0 tokens, preventing Intercom sessions from silently reverting to anonymous after access-token expiry.
Changes:
- Extract
http://lfx.dev/claims/intercomfrom the refreshed ID token claims. - Include
intercomJwtwhen rebuilding theauth_user_profilecookie during/api/auth/refresh.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lewisojile
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
refresh.post.tswas rebuildingauth_user_profilewithoutintercomJwt, causing identified Intercom sessions to silently break after token expiry. Extractshttp://lfx.dev/claims/intercomfrom the refreshed ID token alongsideusername.Root cause
Found while debugging the prod Intercom
Invalid intercom_user_jwterror (primary fix is in linuxfoundation/lfx-v2-argocd#973 — wrong app ID baked at build time). This is a secondary bug: even after that fix, a user whose access token expires would silently revert to an anonymous Intercom session because the refreshedauth_user_profilecookie losesintercomJwt.Test plan
POST /api/auth/refresh) — Intercom should remain identified, not revert to anonymous🤖 Generated with Claude Code