Throw more errors and cleanup some unmerged code

This commit is contained in:
2019-07-26 21:55:59 +02:00
parent 23f9911237
commit 04ba094a14
4 changed files with 12 additions and 30 deletions

View File

@@ -21,7 +21,7 @@ class UserSecurity {
return Promise.resolve()
.then(() => this.userRepository.create(user))
.then(() => UserSecurity.hashPassword(clearPassword))
.then(hash => this.userRepository.changePassword(user, hash));
.then(hash => this.userRepository.changePassword(user, hash))
}
}
@@ -61,7 +61,7 @@ class UserSecurity {
*/
static hashPassword(clearPassword) {
return new Promise((resolve) => {
const salatRounds = 10;
const saltRounds = 10;
bcrypt.hash(clearPassword, saltRounds, (error, hash) => {
resolve(hash);
});