Skip to content

[IDENTITY] PIN-Based Auth and Deterministic Identity Mapping#77

Merged
anonfedora merged 2 commits intoFracverse:masterfrom
floxxih:feature/pin-based-auth-identity-mapping
Feb 26, 2026
Merged

[IDENTITY] PIN-Based Auth and Deterministic Identity Mapping#77
anonfedora merged 2 commits intoFracverse:masterfrom
floxxih:feature/pin-based-auth-identity-mapping

Conversation

@floxxih
Copy link
Contributor

@floxxih floxxih commented Feb 20, 2026

Summary

Implements PIN-based authentication and deterministic identity mapping for the Zaps backend.

Changes

  • IdentityService.createUser: Creates users with bcrypt PIN hashing (10 salt rounds as specified)
  • IdentityService.resolveUserId: Fetches Stellar addresses by app-specific user ID
  • AuthService: JWT implementation with Access & Refresh tokens
  • AuthMiddleware: Protects routes and populates req.user with authenticated user data
  • Endpoints:
    • POST /auth/register - Register a new user
    • POST /user/register - User-facing registration endpoint
    • POST /auth/login - Login with user_id and PIN
    • POST /auth/refresh - Refresh tokens

Acceptance Criteria Met

  • ✅ PINs are never stored in plain text (bcrypt hashed with 10 salt rounds)
  • ✅ JWT tokens contain userId and role

Closes #60

- Implement IdentityService.createUser with bcrypt PIN hashing (10 salt rounds)
- Implement IdentityService.resolveUserId to fetch Stellar addresses by user ID
- Setup AuthService with JWT (Access & Refresh tokens)
- Create AuthMiddleware to protect routes and populate req.user
- Add POST /auth/register and POST /user/register endpoints

PINs are never stored in plain text. JWT tokens contain userId and role.
@anonfedora
Copy link
Collaborator

Check CI, and resolve merge conflicts, pleasee @floxxih

@anonfedora anonfedora merged commit d29fcec into Fracverse:master Feb 26, 2026
2 of 3 checks passed
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.

[IDENTITY] PIN-Based Auth and Deterministic Identity Mapping

2 participants