Repository navigation
Description
The real hook throws the native refusal, but the dialog catches it only with console.error. The button becomes enabled again with the unchanged draft and no alert, field error or toast.
Reproduced against 44e0dcf254975286c0e9dea443b5cd1ca6b23347. Suggested severity: P2.
Reproduction
- Open Settings > API > REST in an authorized shell and open Create API key.
- Let the session expire or become invalid while that dialog remains open. Enter a valid key name and click Create key.
- Observe the dialog after the create request returns 401.
Expected: Show a visible failure explaining that the key was not created and allow the person to recover or sign in again, while preserving the draft.
Actual: The real hook throws the native refusal, but the dialog catches it only with console.error. The button becomes enabled again with the unchanged draft and no alert, field error or toast.
Impact: A valid submission appears to do nothing. The person cannot tell that authentication failed or why retrying the same form will not create a key.
Evidence
The actual Better Auth endpoint returned 401; the actual mutation settled to error. The dialog stayed open with Audit key, an enabled Create key button and no alert/toast. The native memory store contained no key.
Executed from /tmp/tale-audit-settings-44e0dcf2:
/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x --no-install vitest run --config /Users/yannick/.codex/notes/tale-100-findings/access-settings-proof/api-keys-batch2.vitest.config.ts --maxWorkers=1 --reporter=verbose --silent=falseObserved result: 5 passed (5), exit 0, in 3.32 seconds. Frozen observation/control proof: access-settings-proof/api-keys-batch2.test.tsx, config and api-keys-batch2.log.
Controls:
- Valid creation trims surrounding name whitespace, honors Never, reveals a synthetic key once, and clears the reveal/name on Done and reopen.
- Blank and 33-character names are rejected locally without a create request.
- The corresponding revoke refusal displays a destructive toast and preserves the key.
Source
Scope and deduplication
- The actual create/revoke dialogs, API REST page, key table, hooks and Tale authClient run against the actual Better Auth 1.7.5 API-key plugin and native memory adapter. A fetch dispatcher installed before client import admits only /api/auth/api-key/* and calls auth.handler in process. Final proof makes no socket/network request.
- Each test creates fresh synthetic user/session/key rows in memory. Secrets and passwords are random and never printed. No existing user, key, credentials, provider, production data or authentication settings are read or changed. This does not test the production PostgreSQL adapter.
- The route harness supplies organization params and the link shell. It does not mount parent route/session guards: the refusal scenario represents an already authorized shell whose key request is rejected later. The actual API-key client does not redirect on this refusal.
- Query retries are disabled to reach the settled failure state promptly. The application retries ordinary query errors; once retries finish it reaches the same unhandled error state. Window-focus refetch can trigger another request, but it is not a visible error or retry control.
- An initial development-only harness run installed its dispatcher too late, causing Better Auth to try its default localhost URL and receive ECONNREFUSED. That run is retained as api-keys-batch2-working.log and is not evidence for these findings. The frozen passing run installs a closed dispatcher before module evaluation.
- Searched the 931 all-state title cache and current 89-entry accepted ledger for API key, create, refusal, silent and error. No matching current create-refusal finding was present.
- Closed Bug: Form validation parity — create-task title, API-key name, project-secret name, and team name lack client max-length/trim, so server rejections surface as generic toasts (dialog stuck) or persist unbounded #1991 concerns missing client name max-length/trim and generic server-validation toasts. Those rules now pass positive controls. This report uses a valid name and a native authentication refusal that produces no visible feedback. Final parent review is recorded below.
Independent parent verification
Independently reran the actual-client/native-memory-endpoint proof: 5/5 observation and control tests passed, exit 0 (3.61 seconds). Log: access-settings-proof/parent-api-keys-batch2.log. Read the full closed #1991 report: its overlong-name/trim validation now passes the local controls; this valid-name/native-401 and settled-list-failure evidence is distinct. Live all-state GitHub searches for API key loading/failure and the accepted ledger found no matching root.
Activity