Skip to content

Add auth register route and controller#94

Merged
zakkiyyat merged 1 commit intoMixMatch-Inc:mainfrom
hassana123:user-reg
Feb 22, 2026
Merged

Add auth register route and controller#94
zakkiyyat merged 1 commit intoMixMatch-Inc:mainfrom
hassana123:user-reg

Conversation

@hassana123
Copy link
Contributor

Introduce a new auth module: adds POST /auth/register route, a controller that validates input with zod, checks for existing users, hashes passwords with bcrypt, creates a user, and returns a JWT and user payload. Wires the auth router into the app entry (index.ts) and adds zod as a dependency. Validation enforces email, password (min 8 chars) and role (UserRole enum); controller handles duplicate email and generic server errors.
closes #76

Introduce a new auth module: adds POST /auth/register route, a controller that validates input with zod, checks for existing users, hashes passwords with bcrypt, creates a user, and returns a JWT and user payload. Wires the auth router into the app entry (index.ts) and adds zod as a dependency. Validation enforces email, password (min 8 chars) and role (UserRole enum); controller handles duplicate email and generic server errors.
@zakkiyyat zakkiyyat merged commit 5924591 into MixMatch-Inc:main Feb 22, 2026
1 check 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.

User Registration & Password Hashing

2 participants