add is_deactivated
This commit is contained in:
parent
a8976723b2
commit
bb80b8a419
3 changed files with 26 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ export class AuthService {
|
|||
throw new UnauthorizedError('Invalid email or password');
|
||||
}
|
||||
|
||||
// Check if account is deactivated
|
||||
if (user.is_deactivated) {
|
||||
logger.warn('Login attempt with deactivated account', { email, userId: user.id });
|
||||
throw new ForbiddenError('This account has been deactivated');
|
||||
}
|
||||
|
||||
// Verify password
|
||||
const isPasswordValid = await bcrypt.compare(password, user.password);
|
||||
if (!isPasswordValid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue