Repository navigation
fix(dashboard): surface auth-required banner for guest-session database settings (#12709) - #13270
Merged
Merged
Conversation
…se settings (#12709) /api/settings/database and /api/settings/import-json are intentionally ALWAYS_PROTECTED (GHSA-mghq-58h3-qcqj, GHSA-v7g9-7f55-5g46) and correctly 401 a guest/anonymous session. SystemStorageTab.tsx silently collapsed that 401 to null, so the entire database-settings section of Settings -> General just disappeared with zero explanation ("Failed to load settings"). Extract the fetch/detection logic into systemStorageAuth.tsx (new module, keeps SystemStorageTab.tsx within its frozen file-size baseline) and surface an explicit auth-required banner plus a dedicated JSON-import error message instead of a blank page.
7 tasks done
diegosouzapw
added a commit
that referenced
this pull request
Sep 15, 2026
… the Igbo "Model" copy The eight batch-2 catalogs (km, kn, ml, my, ne, or, pa, si) were generated before #12551, #13270 and two other base changes added 10 keys to en.json, and #13660 landed without re-syncing them — `home.topologyLegend*` and `settings.*AuthRequired*` were missing, which fails the home-widget catalog test on the release tip. Translated the 10 keys into each of the eight. Igbo `home.recentRequestsModel` now reads "Nlereanya" instead of the English copy; Uzbek "Model" is a genuine cognate (plural "modellar") and is allowlisted next to Croatian and Slovenian.
Githab-capibara
added a commit
to Githab-capibara/OmniRoute
that referenced
this pull request
Sep 17, 2026
…se settings (cheaper-inference#12709) (cheaper-inference#13270) Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit. Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them. - ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on cheaper-inference#13243) - `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline - 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs - `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for cheaper-inference#13278 and cheaper-inference#13276, annotated and landed on cheaper-inference#13243⚠️ base-red inherited: cheaper-inference#12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…se settings (cheaper-inference#12709) (cheaper-inference#13270) Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit. Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them. - ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on cheaper-inference#13243) - `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline - 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs - `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for cheaper-inference#13278 and cheaper-inference#13276, annotated and landed on cheaper-inference#13243⚠️ base-red inherited: cheaper-inference#12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
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.
Closes #12709
Root cause
/api/settings/databaseand/api/settings/import-jsonare intentionally listed inALWAYS_PROTECTED_API_PATHS(src/server/authz/routeGuard.ts:117-141), a deliberate hardeningfix for GHSA-mghq-58h3-qcqj and GHSA-v7g9-7f55-5g46. A guest/anonymous session (fresh install,
setup wizard skipped, no admin password configured) correctly gets a 401
AUTH_001from bothendpoints — that gate is intentional and is not touched by this PR.
The actual bug was client-side:
SystemStorageTab.tsx(Settings → General) fetched/api/settings/databaseon mount and collapsed any non-2xx response, including this 401, tonullwith zero error state. Every database-settings render helper is gated onif (dbSettingsLoading || !dbSettings) return null;, so the whole section silently disappearedinstead of showing any explanation — matching the reporter's "Failed to load settings"
description. The JSON-import POST path (
handleJsonSelected) had the same blind spot: a guest401 just showed the generic "Failed to import JSON" text.
Fix
src/app/(dashboard)/dashboard/settings/components/systemStorageAuth.tsx(
fetchDatabaseSettingsData,isAuthRequiredResponse,AuthRequiredBanner) —SystemStorageTab.tsxis at its frozen file-size baseline (1597 LOC), so new logic had to live in a new file rather
than growing the frozen one.
SystemStorageTab.tsxnow tracksdbSettingsAuthRequiredand renders an explicit"Authentication required" banner (with a sign-in CTA) in place of the silently-blank section.
(
jsonImportAuthRequired) instead of the generic import-failed text when the response is theintentional 401.
en.jsonstrings (databaseSettingsAuthRequiredTitle/Body/Cta,jsonImportAuthRequired).ALWAYS_PROTECTED_API_PATHS,isAlwaysProtectedPath, andmanagementPolicy's handling of thesetwo routes were not modified — the 401 stays intentional and correct.
Regression test (TDD, Hard Rule #18)
tests/unit/ui/system-storage-tab-guest-401-12709.test.tsxmounts the realSystemStorageTabcomponent with
fetchmocked to return the exact 401/AUTH_001payload from the issue for/api/settings/database, then asserts the rendered text mentions auth/login/401/unauthorized.release/v3.8.51content):npx vitest run tests/unit/ui/system-storage-tab-guest-401-12709.test.tsx→AssertionError: expected false to be trueat thementionsAuthassertion.Gates run
node scripts/check/check-file-size.mjs→ OK (138 frozen files, cap 1200 for new files;SystemStorageTab.tsxstays exactly at its 1597-line baseline)node scripts/check/check-complexity.mjs→ OK (2798 violations vs baseline 3218)node scripts/check/check-cognitive-complexity.mjs→ OK (1265 violations vs baseline 1437)npm run typecheck:core→ cleannpm run check:dashboard-typecheck→ OK, 206 pre-existing errors, all within frozen baseline(no new errors in the touched files)
npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>→clean
npx vitest run tests/unit/ui/system-storage-tab-guest-401-12709.test.tsx→ 1 passed (newregression test)
tests/unit/settings-ui-layout-static.test.ts,tests/unit/dashboard-localization-contract.test.ts,tests/unit/quota-card-grid-mobile-7072.test.ts(23/23 passed vianode --import tsx/esm --test)node scripts/check/check-changelog-integrity.mjs→ OK