Skip to content

Commit

Permalink
fix signUp bug, refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Oct 13, 2024
1 parent 655646f commit 9c0283a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/src/modules/auth/authentication.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class AuthenticationService {

async signUp(user: User, signUpDto: SignUpDto): Promise<void> {
const { oneTimePassword, newPassword } = signUpDto;
if (await this.isPasswordValid(user, oneTimePassword)) {
if (!(await this.isPasswordValid(user, oneTimePassword))) {
throw new UnauthorizedException();
}
user.isActive = true;
Expand Down
2 changes: 1 addition & 1 deletion api/test/integration/auth/create-user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Create Users', () => {
expect(response.status).toBe(HttpStatus.CONFLICT);
// And the user should receive a message containing "Email already exists"
expect(response.body.errors[0].title).toBe(
`Email ${testUser.email} already exists`,
`User with email ${testUser.email} already exists`,
);
});

Expand Down

0 comments on commit 9c0283a

Please sign in to comment.