Creating import&export excel
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user