fix(tradein/auth): honest 401/error screens in RouteGuard instead of misleading text #2516

Merged
lekss361 merged 1 commit from fix/tradein-routeguard-401-screen into main 2026-07-13 20:19:13 +00:00

1 commit

Author SHA1 Message Date
bot-backend
b176b1bc44 fix(tradein/auth): honest 401/error screens in RouteGuard instead of misleading text
All checks were successful
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
CI / changes (pull_request) Successful in 7s
CI Trade-In / changes (pull_request) Successful in 7s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Successful in 1m1s
Session-expired (401) screen already existed but its CTA button was
mislabeled "Выйти" (logout) and called logout() with no reload alternative;
generic non-401/403 errors (500 / network fail) reused variant="user"
whose copy ("аккаунт не привязан к роли") is wrong for a technical failure.

- NoAccessScreen: session variant now shows "Войти снова" button that does
  window.location.reload() (basic_auth top-level nav reload re-triggers the
  browser's auth challenge on rejected creds) instead of full logout.
- New "error" variant for non-401/403 useMe() failures — honest copy +
  "Обновить страницу" reload CTA, replacing the misleading "user" text.
- RouteGuard: generic catch-all error branch now routes to variant="error".
- trial (role=expired) and 403 (variant="user") screens unchanged.
2026-07-13 22:49:15 +03:00