Skip to content

Commit

Permalink
Merge pull request #134 from kauandotnet/hotfix/validate-active-user
Browse files Browse the repository at this point in the history
fix: await promise before check the result
  • Loading branch information
MrMaz authored Oct 30, 2023
2 parents 4dccb93 + 8ccc400 commit 858bcb9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ export class AuthLocalValidateUserService
throw new Error(`No user found for username: ${dto.username}`);
}

const isUserActive = await this.isActive(user);

// is the user active?
if (!this.isActive(user)) {
if (!isUserActive) {
throw new Error(`User with username '${dto.username}' is inactive`);
}

Expand Down

0 comments on commit 858bcb9

Please sign in to comment.