show specific message in login
This commit is contained in:
parent
399590a904
commit
5b35e0b044
|
|
@ -407,7 +407,7 @@ namespace OnlineSalesAutoCrop.CoreAPI.Services.Services.Systems
|
||||||
{
|
{
|
||||||
tc.End();
|
tc.End();
|
||||||
response = new();
|
response = new();
|
||||||
response.IsAuthorized = true;
|
response.IsAuthorized = false;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,15 +102,15 @@ namespace OnlineSalesAutoCrop.CoreAPI.Controllers
|
||||||
ipAddress = Request.HttpContext.GetIpAddress();
|
ipAddress = Request.HttpContext.GetIpAddress();
|
||||||
loginReponse = await _service.LoginAsync(request: request, ipAddress: ipAddress);
|
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));
|
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));
|
return Unauthorized(MobileResponseBase<AppAuthUserResponse>.Failure(message, StatusCodes.Status401Unauthorized));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user