diff --git a/packages/nestjs-auth-local/src/services/auth-local-validate-user.service.ts b/packages/nestjs-auth-local/src/services/auth-local-validate-user.service.ts index 348dc30f6..7d8b6a728 100644 --- a/packages/nestjs-auth-local/src/services/auth-local-validate-user.service.ts +++ b/packages/nestjs-auth-local/src/services/auth-local-validate-user.service.ts @@ -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`); }