MCPcopy Create free account
hub / github.com/Datakitpage/Datakit / create

Method create

backend/api/src/users/users.service.ts:18–34  ·  view source on GitHub ↗
(email: string, password: string, name?: string)

Source from the content-addressed store, hash-verified

16 ) {}
17
18 async create(email: string, password: string, name?: string): Promise<User> {
19 const existingUser = await this.findByEmail(email);
20 if (existingUser) {
21 throw new ConflictException('User with this email already exists');
22 }
23
24 // Use stronger salt rounds (12 instead of 10) for better security
25 const saltRounds = parseInt(process.env.BCRYPT_SALT_ROUNDS || '12');
26 const hashedPassword = await bcrypt.hash(password, saltRounds);
27 const user = this.usersRepository.create({
28 email,
29 password: hashedPassword,
30 name,
31 });
32
33 return this.usersRepository.save(user);
34 }
35
36 async findAll(): Promise<User[]> {
37 return this.usersRepository.find();

Callers 10

generateCompletionMethod · 0.45
duckDBStore.tsFile · 0.45
bootstrapFunction · 0.45
signupMethod · 0.45
generateRefreshTokenMethod · 0.45
recordUsageMethod · 0.45

Calls 1

findByEmailMethod · 0.95

Tested by

no test coverage detected