Creating import&export excel

This commit is contained in:
2026-09-15 17:33:05 +03:30
parent 9ae176bec0
commit 44f9849d0e
26 changed files with 3682 additions and 474 deletions
+13
View File
@@ -278,6 +278,9 @@ export class AuthService {
if (!user) {
throw new UnauthorizedException('اطلاعات ورود نادرست است');
}
if (user.isActive === false) {
throw new UnauthorizedException('حساب کاربری غیرفعال است');
}
const ok = await bcrypt.compare(dto.password, user.passwordHash);
if (!ok) {
@@ -298,6 +301,9 @@ export class AuthService {
if (!user) {
throw new UnauthorizedException('حسابی با این موبایل یافت نشد');
}
if (user.isActive === false) {
throw new UnauthorizedException('حساب کاربری غیرفعال است');
}
await this.throttleChallenges('login', user.email, mobile);
@@ -352,6 +358,9 @@ export class AuthService {
if (!user) {
throw new UnauthorizedException();
}
if (user.isActive === false) {
throw new UnauthorizedException('حساب کاربری غیرفعال است');
}
const now = new Date();
await this.prisma.authChallenge.update({
@@ -600,6 +609,10 @@ export class AuthService {
organizationId: user.organizationId,
role: user.role,
};
await this.prisma.user.update({
where: { id: user.id },
data: { lastLoginAt: new Date() },
});
return {
accessToken: this.jwt.sign(payload),
user: await this.toAuthUserDto(user),