Skip to content

Commit

Permalink
last updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansourkira committed Dec 4, 2023
1 parent ce800f9 commit a0c3092
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/authentication/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ class HajarAuth {
});

if (existingUserWithSameUsername) {
userDetails.username = generateUniqueUsername(userDetails.username);
throw new HajarError(
"User with this username already exists",
"user-already-exist",
{ username: userDetails.username }
);
}

const hashedPassword = await this.bcrypt.hash(userDetails.password, 10);
Expand Down

0 comments on commit a0c3092

Please sign in to comment.