Skip to content

Wallet signature authentication (challenge + verify) #11

Description

@Cbiux

Summary

Verify and fix wallet signature authentication end-to-end in production after #15 (DATABASE_URL) is configured.

Code is merged (SEP-53 challenge, JWT sessions, rate limits). Production auth still fails without DB and needs a final QA pass.


Implemented (do not re-build)

Layer Files
Challenge + verify Server/src/services/auth-challenge.service.ts
JWT sessions Server/src/services/session.service.ts, session.middleware.ts
Auth routes POST /api/auth/challenge, /register/signed, /login/signed
Front Front/lib/wallet-kit.ts, wallet-auth-card.tsx, auth.ts, api-client.ts
Tests Server/src/services/__tests__/verifyWalletSignature.test.ts, integration tests in CI

Production checklist

  1. Provision production MySQL and configure DATABASE_URL on Vercel #15 doneDATABASE_URL + JWT_SECRET on Vercel
  2. Redeploy zcore-api and dapp-zcore
  3. Confirm NEXT_PUBLIC_API_BASE_URL=https://zcore-api.vercel.app
  4. Confirm NEXT_PUBLIC_STELLAR_NETWORK=testnet matches Freighter network
  5. Full flow: connect wallet → sign challenge → land on /dashboard with JWT in sessionStorage

Acceptance criteria

  • Register new wallet on prod returns 201 + data.token
  • Login existing wallet returns 200 + data.token
  • GET /api/user/{wallet}/profile with Authorization: Bearer returns 200
  • Invalid signature returns 401 (not 500)
  • Document any Freighter/xBull quirks in CONTRIBUTING.md

How to verify locally

npm run setup
npm run dev:server
npm run dev:front
# Use Freighter testnet wallet at http://localhost:3001/register

Out of scope

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSPart of the GrantFox OSS programMaybe RewardedThis issue may receive a reward or bountyOfficial CampaignPart of an official ZCore campaignbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions