Browse Source

EmailNotExist error

zinab_elgendy 1 week ago
parent
commit
7e044b3c50
1 changed files with 2 additions and 2 deletions
  1. 2 2
      MTWorkHR.Application/Services/Auth/AuthService.cs

+ 2 - 2
MTWorkHR.Application/Services/Auth/AuthService.cs

@@ -35,12 +35,12 @@ namespace MTWorkHR.Identity.Services
             var user = await _userManager.FindByEmailAsync(request.Email);           
             if (user == null)
             {
-                throw new AppException(ExceptionEnum.RecordNotExist);
+                throw new AppException(ExceptionEnum.EmailNotExist);
             }
             var result = await _signInManager.CheckPasswordSignInAsync(user, request.Password, false);
             if(!result.Succeeded)
             {
-                throw new AppException($"Credentials for '{request.Email} are not valid'.");
+                throw new AppException(GlobalInfo.lang == "en"? $"Credentials for '{request.Email} are not valid'." : $"كلمة المرور غير صحيحة.");
             }
             var userResponse = await _userService.GetById(user.Id);