Repository navigation
UI auth: refine session token handling - #36250
Conversation
Bot, bot-impersonation and personal access tokens are meant for API clients. getOidcToken now drops such a token (clearing the session and showing a single toast), so a token injected into storage - on load or mid-session - never reaches a request and the user lands on sign-in. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
- getOidcToken notifies a listener instead of toasting itself, keeping ToastUtils/i18n off the boot bundle (fixes bundle budget/runtime check) - AuthProvider registers the listener: toast + full sign-out, which pauses the AuthCoordinator so a silent SSO renewal cannot restore the session - Translate api-only-token-ui-access-denied in all locales - Fix no-use-before-define on clearOidcToken Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
IngestionBot.spec.ts drove the UI with the ingestion bot's JWT, which the UI now rejects. DomainIsolationIT now checks the same guarantee at the API, using the bot's stored token so isBot/tokenType claims are exercised: the bot can read a domain-assigned table and its domain-assigned service. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
✅ SSO Login Nightly — PASSED View workflow run · Commit
Totals: 118 passed · 0 failed · 0 flaky · 0 skipped · duration 25m 11s |
🚦 Removed from the merge queue —
|
Resolve the positional-locator baseline: main removed two, this branch removes one (IngestionBot spec), so the count is 535. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| Count | Rule |
|---|---|
| 8 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:347:9 |
react-hooks/exhaustive-deps |
The 'onLoginHandler' function makes the dependencies of useMemo Hook (at line 1231) change on every render. Move it inside the useMemo callback. Alternatively, |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:470:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'navigate', 'setApplicationLoading', 'setCurrentUser', and 'setIsAuthenticated'. Either include them or remove |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:567:9 |
react-hooks/exhaustive-deps |
The 'resetUserDetails' function makes the dependencies of useMemo Hook (at line 1231) change on every render. To fix this, wrap the definition of 'resetUserDeta |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:813:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'handleRefreshFailed', 'handleStoreProtectedRedirectPath', 'setIsAuthenticated', and 'signOutAfterRefreshFailure' |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:815:9 |
react-hooks/exhaustive-deps |
The 'handleFailedLogin' function makes the dependencies of useMemo Hook (at line 1231) change on every render. Move it inside the useMemo callback. Alternativel |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:886:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'handledVerifiedUser', 'navigate', and 'resetUserDetails'. Either include them or remove the dependency array. |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:937:9 |
react-hooks/exhaustive-deps |
The 'initializeAxiosInterceptors' function makes the dependencies of useMemo Hook (at line 1231) change on every render. To fix this, wrap the definition of 'in |
| 🟡 | src/components/Auth/AuthProviders/AuthProvider.tsx:1220:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchAuthConfig'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
🚦 Removed from the merge queue —
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review ✅ Approved 2 closed / 2 findings🔴 High risk · Rejecting bot and personal-access tokens during UI token reads changes authentication decisions and could sign out sessions relying on those tokens. Restricts the UI to user login tokens by rejecting bot, bot-impersonation and PAT tokens in ✅ 2 closed✅ Quality: New error toast left in English in all 20 non-English locales
✅ Quality: UI-only-accepts-login-tokens rule has no decision record
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Refines how the UI handles session tokens. Interactive UI sessions now use tokens from the login flow, and API tokens (bot and personal access tokens) are meant for API clients only. REST API behaviour is unchanged.
SwTokenStorageUtils:isApiOnlyToken()classifies stored tokens.getOidcToken()clears the session for API-only tokens and notifiesAuthProvider, which runs the standard sign-out.server.api-only-token-ui-access-denied, translated in all locales.ADR:2026-10-27-ui-runs-only-on-user-login-tokens.Test updates
playwright/e2e/Flow/IngestionBot.spec.tsis replaced byDomainIsolationIT.test_ingestionBot_readsDomainAssetAndService, which checks the same domain access through the API./test/id-tokenendpoint inmock-oidc-provider), and its CI leg now starts that container.Follow-ups: #36318, #36319
Test plan
SwTokenStorageUtils.test.tsandAuthProvider.test.tsx; auth suites pass (390)DomainIsolationIT#test_ingestionBot_readsDomainAssetAndServicepasses locallycheck-i18n,yarn build,bundle:check,bundle:runtime🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with no new actionable findings.Summary
The UI rejects bot tokens and personal access tokens stored as session tokens. Rejection clears the stored session and asks
AuthProviderto sign out.Previous-thread outcomes: translations are fixed, and rejection now calls the explicit sign-out path. chirag-madlani accepted the remaining in-flight refresh race and its real-coordinator test as follow-up work in #36319. Greptile withdrew the related test finding.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Read stored token"] --> B{"API-only token?"} B -->|No| C["Return token"] B -->|Yes| D["Clear stored session"] D --> E["Notify AuthProvider"] E --> F["Show translated message"] F --> G["Run standard sign-out"]Reviews (9) · Last reviewed commit: "Tidy wording in the session-token decisi..." · Reviewed by Greptile