Skip to content

fix(web): differentiate admin auth read failure and localize admin gate - #1196

Open
chuks68 wants to merge 2 commits into
drydocs:mainfrom
chuks68:fix/admin-login-error-state-and-i18n
Open

chuks68 wants to merge 2 commits into
drydocs:mainfrom
chuks68:fix/admin-login-error-state-and-i18n

Conversation

@chuks68

@chuks68 chuks68 commented Oct 19, 2026

Copy link
Copy Markdown

this pr closes #1065

Summary

Resolves two issues in the /admin gate:

  1. Separate RPC Read Failure from Unauthorized: Previously, fetchVaultAdmin promise rejections were funneled into { authorized: false }, showing an unauthorized message to legitimate admins when RPC calls timed out or failed. This change tracks read errors separately and renders a dedicated error screen with a retry button and switch-wallet action.
  2. Complete Localization:
    • Replaced all hardcoded English strings in AdminLogin.tsx with translations via useTranslation(), utilizing existing keys (admin.connectPrompt, admin.notAuthorized) and adding admin.access, admin.readError, admin.switchWallet, admin.connected, and admin.loading across en.json and fr.json.
    • Wired the unused walletConnect.chooseWallet key to the wallet picker menu aria-label in WalletConnect.tsx.

Verification

  • Unit tests in AdminLogin.test.tsx assert retry behavior on RPC read failure, non-admin blocked behavior, and rendering of localized strings in French (fr).
  • Unit tests in WalletConnect.test.tsx assert the walletConnect.chooseWallet accessible label.
  • All 40 @meridian/web test suites passed (vitest run).

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@chuks68 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

@chuks68 is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chuks68
chuks68 force-pushed the fix/admin-login-error-state-and-i18n branch from c505153 to a32819d Compare October 20, 2026 15:43

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The retry state and translations are correct, and the tests pass. pnpm format:check fails on apps/web/src/pages/AdminLogin.tsx; run pnpm prettier --write apps/web/src/pages/AdminLogin.tsx and push. All other required checks pass.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@chuks68 the retry and error states are correct and the translations are covered. Lint & Typecheck still fails on the Prettier check for AdminLogin.tsx (lines 96-98 and 133); run pnpm prettier --write apps/web/src/pages/AdminLogin.tsx and push. The E2E Tests failure is the withdraw spec against the live API, not this change.

The connected wallet doesn't match the vault's admin address. This
page is only accessible to the vault admin.
</p>
<h1 className="text-xl font-bold text-paper">{t("admin.notAuthorized")}</h1>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prettier splits this line; run pnpm prettier --write apps/web/src/pages/AdminLogin.tsx. The same check also joins the readError paragraph at lines 96-98.

This branch has not been deployed

No deployments
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.

[Bug] AdminLogin reports a read failure as not authorized and ignores the shipped translations

2 participants