show specific message in login

This commit is contained in:
dibakor 2026-07-27 18:16:10 +06:00
parent 399590a904
commit 5b35e0b044
2 changed files with 8 additions and 8 deletions

View File

@ -407,7 +407,7 @@ namespace OnlineSalesAutoCrop.CoreAPI.Services.Services.Systems
{
tc.End();
response = new();
response.IsAuthorized = true;
response.IsAuthorized = false;
return response;
}

View File

@ -102,15 +102,15 @@ namespace OnlineSalesAutoCrop.CoreAPI.Controllers
ipAddress = Request.HttpContext.GetIpAddress();
loginReponse = await _service.LoginAsync(request: request, ipAddress: ipAddress);
if (loginReponse == null || loginReponse.UserId == 0)
if (loginReponse.LoginStatus == EnumLoginStatus.Unsuccessful)
{
string message = "Login ID/Password is invalid.\" : \"You are not Authorized to login into the System.";
string message = checkPwd ? $"Password is invalid for {request.LoginId}." : "You are not Authorized to login into the System";
return Unauthorized(MobileResponseBase<AppAuthUserResponse>.Failure(message, StatusCodes.Status401Unauthorized));
}
if (loginReponse.LoginStatus == EnumLoginStatus.Unsuccessful)
if (loginReponse == null || loginReponse.UserId == 0 || loginReponse.IsAuthorized ==false)
{
string message = checkPwd ? $"Login ID/Password is invalid for {request.LoginId}." : "You are not Authorized to login into the System";
string message = "Login ID is invalid.\" : \"You are not Authorized to login into the System.";
return Unauthorized(MobileResponseBase<AppAuthUserResponse>.Failure(message, StatusCodes.Status401Unauthorized));
}