updated accounts service navigator

This commit is contained in:
2025-08-03 18:23:26 +03:00
parent 1b87dee60d
commit aa8f0b8f31
24 changed files with 398 additions and 211 deletions

View File

@@ -5,8 +5,8 @@ import {
UnauthorizedException,
} from '@nestjs/common';
import { userChangePasswordValidator } from './dtoValidator';
import { RedisHandlers } from '@/src/utils/auth/redis_handlers';
import { PasswordHandlers } from '@/src/utils/auth/login_handler';
import { RedisHandlers } from '@/src/utils/auth/redisHandlers';
import { PasswordHandlers } from '@/src/utils/auth/loginHandler';
@Injectable()
export class ChangePasswordService {
@@ -14,7 +14,7 @@ export class ChangePasswordService {
private readonly prisma: PrismaService,
private readonly redis: RedisHandlers,
private readonly passHandlers: PasswordHandlers,
) {}
) { }
private async syncPasswordHistory(
foundUser: any,
@@ -84,18 +84,18 @@ export class ChangePasswordService {
password: hashPassword,
...(oldestIndex === 'first'
? {
old_password_first: dto.password,
old_password_first_modified_at: new Date(),
}
old_password_first: dto.password,
old_password_first_modified_at: new Date(),
}
: oldestIndex === 'second'
? {
old_password_second: dto.password,
old_password_second_modified_at: new Date(),
}
old_password_second: dto.password,
old_password_second_modified_at: new Date(),
}
: {
old_password_third: dto.password,
old_password_third_modified_at: new Date(),
}),
old_password_third: dto.password,
old_password_third_modified_at: new Date(),
}),
},
});
}