You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
489 B
18 lines
489 B
const bcrypt = require('bcrypt');
|
|
|
|
class UserService {
|
|
static async createUser(userData) {
|
|
// Hacher le mot de passe avant de le stocker dans la base de données
|
|
const hashedPassword = await bcrypt.hash(userData.password, 10);
|
|
|
|
// Retournez l'utilisateur créé
|
|
return { pseudo: userData.pseudo, password: hashedPassword };
|
|
}
|
|
|
|
static async initUserStats(idUser) {
|
|
return { nbGames: 0, nbWins: 0, ratio: 0.0, idUser: idUser };
|
|
}
|
|
}
|
|
|
|
module.exports = UserService;
|