implement auth login and register with MongoDB
- Add AuthController login/register endpoints with error handling - Implement AuthService with password validation and user creation - Add MongoUserRepository with findByEmail and create methods - Implement password hashing with bcrypt - Add dotenv for environment variable support - Add Docker Compose setup for MongoDB + Mongo Express - Stub AuthMiddleware with fake user for testing - Update CLAUDE.md with implementation status
This commit is contained in:
@@ -3,9 +3,9 @@ import bcrypt from 'bcrypt';
|
||||
const SALT_ROUNDS = 10;
|
||||
|
||||
export async function hash(password: string): Promise<string> {
|
||||
throw new Error('Not implemented');
|
||||
return bcrypt.hash(password, SALT_ROUNDS);
|
||||
}
|
||||
|
||||
export async function compare(password: string, hash: string): Promise<boolean> {
|
||||
throw new Error('Not implemented');
|
||||
return bcrypt.compare(password, hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user