Skip to content

[Backend] Remove legacy mock wallet authentication #306

@Kaylahray

Description

@Kaylahray

Description

The login and register handlers still implement mock wallet signature verification, even though the app also contains a challenge and verify flow.

User Story

As a wallet user,
I want to authenticate with a real signed challenge,
so that my session is issued from a verifiable Stellar proof.

Requirements and Context

  • Files: app/app/(auth)/login/route.ts, app/app/(auth)/register/route.ts, app/app/api/auth/challenge/route.ts, app/app/api/auth/verify/route.ts
  • Remove or fully retire the legacy mock signature verification path
  • Make the challenge/verify flow the canonical login path
  • Keep replay protection and nonce verification intact

Suggested Implementation

// AUTH REFACTOR
// 1. Issue a challenge nonce.
// 2. Verify the signed challenge with Stellar tooling.
// 3. Create or fetch the user record.
// 4. Mint the session token only after verification succeeds.

Acceptance Criteria

  • Legacy mock signature verification is no longer used in production flows.
  • Challenge replay attacks remain blocked.
  • Login and registration share the same secure verification model.

Submission Guidelines

  • Branch: feat/remove-mock-wallet-auth
  • Depends on: SEP-10 verification flow
  • PR: feat(backend): retire mock wallet auth and unify challenge verification

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions