Skip to content

fix(claim): move SIWE to Step 1 and harden wallet auth UX#266

Merged
GsCommand merged 1 commit into
mainfrom
codex/fix-siwe-button-and-move-to-step-1
May 22, 2026
Merged

fix(claim): move SIWE to Step 1 and harden wallet auth UX#266
GsCommand merged 1 commit into
mainfrom
codex/fix-siwe-button-and-move-to-step-1

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Ensure the Sign-In with Ethereum action always provides visible feedback and gate Step 1 of the Claim flow on a successful wallet authentication.
  • Improve robustness of the SIWE flow (provider detection, account/chain handling, nonce/signature errors) and align frontend statement with server verifier.

Description

  • Moved Sign-In with Ethereum UI into Step 1 and relocated the ENS/name input to Step 3, updating progress labels to the new order.
  • Made the handler globally accessible as window.signInWithEthereum so inline onclick always resolves, and disabled the Step 1 Continue button until authentication succeeds.
  • Added visible button loading/success/error states and a #siweError area; clicking disables the button and shows Waiting for wallet... / Requesting wallet signature..., success shows Wallet authenticated and enables Continue, failures restore the button and display a clear error.
  • Hardened wallet flow: explicit check for window.ethereum, eth_requestAccounts handling with no-account error, eth_chainId parsing, and robust handling of /api/auth/nonce failures and signature rejection (wallet error code 4001).
  • Built a plain SIWE message string and updated backend api/auth/verify.js to expect the exact statement Authenticate with CommandLayer Claim activation. to ensure frontend/backend alignment.
  • Preserved existing constraints: no payment/provisioning added, Ed25519 key generation unchanged, no fake auth/ENS/registration, and no schema changes.

Testing

  • Ran npm install (succeeded).
  • Ran npm test and all repository unit tests passed (SIWE-related tests remain passing as shown in suite output).
  • npm run build failed because the repo does not define a build script (noted in output).
  • Ran cd examples/webhook-auto-verify && npm install and npm run check in that example and both succeeded.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commandlayer-commandlayer-org Ready Ready Preview, Comment May 22, 2026 2:39am
commandlayer-org Ready Ready Preview, Comment May 22, 2026 2:39am
commandlayer-org111 Ready Ready Preview, Comment May 22, 2026 2:39am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant