This commit is contained in:
@@ -71,11 +71,10 @@ namespace AyaNova.Api.Controllers
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
}
|
||||
|
||||
int nFailedAuthDelay = 3000;//should be just long enough to make brute force a hassle but short enough to not annoy people who just mistyped their creds to login
|
||||
|
||||
|
||||
|
||||
#if (DEBUG)
|
||||
nFailedAuthDelay = 1;
|
||||
|
||||
|
||||
#region TESTING
|
||||
|
||||
@@ -150,7 +149,7 @@ namespace AyaNova.Api.Controllers
|
||||
if (string.IsNullOrWhiteSpace(creds.Login) || string.IsNullOrWhiteSpace(creds.Password))
|
||||
{
|
||||
//Make a failed pw wait
|
||||
await Task.Delay(nFailedAuthDelay);
|
||||
await Task.Delay(AyaNova.Util.ServerBootConfig.FAILED_AUTH_DELAY);
|
||||
return StatusCode(401, new ApiErrorResponse(ApiErrorCode.AUTHENTICATION_FAILED));
|
||||
}
|
||||
|
||||
@@ -249,7 +248,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
//No users matched, it's a failed login
|
||||
//Make a failed pw wait
|
||||
await Task.Delay(nFailedAuthDelay);
|
||||
await Task.Delay(AyaNova.Util.ServerBootConfig.FAILED_AUTH_DELAY);
|
||||
return StatusCode(401, new ApiErrorResponse(ApiErrorCode.AUTHENTICATION_FAILED));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user