CelestiumX / CelestiumX/SkillChain-Backend

Design Authentication Service

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
good first issue Manteiner:Yuli Non-rewarded ODHack13
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## 📚 Overview
Implement a secure authentication system that supports both wallet signature login and traditional email/password flows using JWTs for session handling.

If you need coordination or clarification, use the project’s [[Telegram Group](https://t.me/+YZEXOc_LOzIyYTgx)](https://t.me/+YZEXOc_LOzIyYTgx).

---

## 🔍 Background
Authentication is a foundational layer for the SkillChain ecosystem. Ensuring secure, role-aware access will provide the necessary infrastructure for both Web3 and Web2 users.

---

## 🛠 Requirements
- Create auth logic in `src/services/auth` and related pages/components
- Email/password authentication using Argon2 for secure password hashing
- Wallet signature login via crypto wallets (e.g., MetaMask)
- Issue JWTs with proper expiration and refresh token handling
- Role-based access control (freelancer, client, firm)
- Implement rate limiting: 10 requests per minute per IP
- Secure cookie/session/token handling

---

## 🔧 Implementation Plan

### 1. Create Feature Branch
```bash
git checkout -b feature-auth-system-[issue-number]
```

### 2. Email/Password Flow
- Hash passwords using Argon2
- Validate credentials on login and return JWT
- Store tokens securely (e.g., HttpOnly cookies)

### 3. Wallet Login Flow
- Prompt user for wallet signature
- Verify signed message and issue JWT

### 4. Role-based Access
- Define middleware to guard routes by role
- Enforce access in backend and frontend

### 5. Session and Rate Limiting
- Apply rate limiter middleware
- Ensure JWTs expire and support refresh tokens

### 6. Testing
- Unit test each flow (minimum 90% coverage)
- Include edge cases: invalid tokens, expired sessions, rate limit triggers

### 7. Commit and Push
```bash
git add .
git commit -m "Feature: Secure Auth System with JWT and Wallet Login"
git push origin feature-auth-system-[issue-number]
```

---

## ✅ Definition of Done
- [ ] JWT-based authentication is working for both login types
- [ ] Passwords stored securely with Argon2
- [ ] Sessions expire and refresh appropriately
- [ ] All roles enforced through middleware
- [ ] Unit test coverage ≥ 90%
- [ ] Pull request meets template standards

---

## 📆 Timeframe
3 days

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting src/services/auth and the related pages/components to map the existing authentication entry points. Review how backend and frontend routes, roles, sessions, and tokens are currently handled before defining the implementation scope. Done means both login flows, role enforcement, session handling, rate limiting, and the stated tests and coverage target are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, backend, frontend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.