diff --git a/src/auth/auth-services/actor.auth.service.ts b/src/auth/auth-services/actor.auth.service.ts index 736c754..1bff64b 100644 --- a/src/auth/auth-services/actor.auth.service.ts +++ b/src/auth/auth-services/actor.auth.service.ts @@ -210,13 +210,13 @@ export class ActorAuthService { ): Promise { const user = await this.dynamicDbController(role, username); if (!user) { - throw new NotFoundException("Actor account not found"); + throw new NotFoundException("حساب کاربری یافت نشد"); } if (user.role !== role) { - throw new UnauthorizedException("user not assigned to this role"); + throw new UnauthorizedException("این حساب به نقش انتخاب‌شده تعلق ندارد"); } if (!(await this.hashService.compare(pass, user.password))) { - throw new UnauthorizedException("password is incorrect or access Denied"); + throw new UnauthorizedException("نام کاربری یا رمز عبور اشتباه است"); } return user; } @@ -229,7 +229,7 @@ export class ActorAuthService { const username = this.parseActorLoginUsername(body); const password = body?.password; if (typeof password !== "string" || !password) { - throw new BadRequestException("password is required"); + throw new BadRequestException("رمز عبور الزامی است"); } const captchaId = typeof body?.captchaId === "string" ? body.captchaId : undefined; diff --git a/src/auth/auth-services/captcha-auth.error.ts b/src/auth/auth-services/captcha-auth.error.ts index 0baac20..f9f4620 100644 --- a/src/auth/auth-services/captcha-auth.error.ts +++ b/src/auth/auth-services/captcha-auth.error.ts @@ -12,12 +12,12 @@ export enum CaptchaAuthErrorCode { const messages: Record = { [CaptchaAuthErrorCode.CAPTCHA_REQUIRED]: - "Captcha is required. Request a new captcha image first.", + "کپچا الزامی است. ابتدا تصویر کپچا را دریافت کنید.", [CaptchaAuthErrorCode.CAPTCHA_NOT_FOUND]: - "Captcha id was not found. Request a new captcha image.", + "شناسه کپچا یافت نشد. تصویر جدیدی درخواست دهید.", [CaptchaAuthErrorCode.CAPTCHA_EXPIRED]: - "Captcha has expired. Request a new captcha image.", - [CaptchaAuthErrorCode.CAPTCHA_INVALID]: "Captcha is invalid.", + "کپچا منقضی شده است. تصویر جدیدی درخواست دهید.", + [CaptchaAuthErrorCode.CAPTCHA_INVALID]: "کپچا نامعتبر است.", }; export function captchaAuthErrorBody(code: CaptchaAuthErrorCode) { diff --git a/src/auth/auth-services/user-auth-error.ts b/src/auth/auth-services/user-auth-error.ts index efc2de4..8b4a767 100644 --- a/src/auth/auth-services/user-auth-error.ts +++ b/src/auth/auth-services/user-auth-error.ts @@ -15,15 +15,15 @@ export enum UserAuthErrorCode { } const messages: Record = { - [UserAuthErrorCode.USER_NOT_FOUND]: "User not found", - [UserAuthErrorCode.OTP_REQUIRED]: "Please request an OTP first", - [UserAuthErrorCode.OTP_EXPIRED]: "OTP has expired", - [UserAuthErrorCode.OTP_INVALID]: "OTP is invalid", + [UserAuthErrorCode.USER_NOT_FOUND]: "کاربر یافت نشد", + [UserAuthErrorCode.OTP_REQUIRED]: "ابتدا درخواست کد یکبار مصرف دهید", + [UserAuthErrorCode.OTP_EXPIRED]: "کد یکبار مصرف منقضی شده است", + [UserAuthErrorCode.OTP_INVALID]: "کد یکبار مصرف نامعتبر است", [UserAuthErrorCode.OTP_REQUEST_TOO_SOON]: - "Wait for expiry time to finish before requesting another OTP", - [UserAuthErrorCode.LINK_NOT_FOUND]: "Linked SMS token was not found", + "لطفاً تا انقضای کد فعلی صبر کنید", + [UserAuthErrorCode.LINK_NOT_FOUND]: "لینک پیامکی یافت نشد", [UserAuthErrorCode.LINK_MOBILE_MISMATCH]: - "This mobile number is not allowed to use this SMS link", + "این شماره موبایل مجاز به استفاده از این لینک نیست", }; export function userAuthErrorBody(code: UserAuthErrorCode) {