Skip to content

fix(frontend): preserve intercomJwt through token refresh#160

Open
mlehotskylf wants to merge 2 commits into
mainfrom
fix/intercom-prod-app-id-clean
Open

fix(frontend): preserve intercomJwt through token refresh#160
mlehotskylf wants to merge 2 commits into
mainfrom
fix/intercom-prod-app-id-clean

Conversation

@mlehotskylf

Copy link
Copy Markdown
Contributor

Summary

refresh.post.ts was rebuilding auth_user_profile without intercomJwt, causing identified Intercom sessions to silently break after token expiry. Extracts http://lfx.dev/claims/intercom from the refreshed ID token alongside username.

Root cause

Found while debugging the prod Intercom Invalid intercom_user_jwt error (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 refreshed auth_user_profile cookie loses intercomJwt.

Test plan

  • Log in, confirm Intercom boots with identity
  • Force token refresh (POST /api/auth/refresh) — Intercom should remain identified, not revert to anonymous

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 15, 2026 23:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/intercom from the refreshed ID token claims.
  • Include intercomJwt when rebuilding the auth_user_profile cookie during /api/auth/refresh.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants