Przeglądaj źródła

EmailNotExist error

zinab_elgendy 1 tydzień temu
rodzic
commit
7e044b3c50

+ 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);