Skip to content

Implement Wallet-Based Authentication (Auth Module MVP) #32

@phertyameen

Description

@phertyameen

Set up the auth module to support wallet-based authentication. Users should log in by signing a message with their wallet (MetaMask, WalletConnect, etc.), and the backend will verify the signature. A JWT will be returned to maintain the session.

Tasks:

Install ethers.js (or viem) for signature verification.

Create AuthController with endpoints:

POST /auth/request-message → returns nonce for signature.

POST /auth/verify → verifies signed message, returns JWT.

Store nonces temporarily in Redis to prevent replay attacks.

Configure JWT strategy in NestJS (Passport + JWT).

Protect routes using AuthGuard.

Acceptance Criteria:

✅ Users can log in by signing a message.

✅ Server verifies ownership of wallet address.

✅ JWT is issued and used to access protected routes.

Attach a sample request to the test on pr submit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions