End User License consent system added

This commit is contained in:
2022-02-12 00:50:51 +00:00
parent 95f5d0dd53
commit b75d46324f
8 changed files with 81 additions and 16 deletions

View File

@@ -71,6 +71,12 @@ namespace AyaNova.Api.Controllers
//NOTE: lockout or other login impacting state is processed later in ReturnUserCredsOnSuccessfulAuthentication() because many of those states need to have exceptions once the user is known
//or return alternate result of auth etc
if (Core.License.LicenseConsentRequired)
{
await Task.Delay(AyaNova.Util.ServerBootConfig.FAILED_AUTH_DELAY);
return StatusCode(401, new ApiErrorResponse(ApiErrorCode.AUTHENTICATION_FAILED, "generalerror", "License agreement consent required"));
}
if (string.IsNullOrWhiteSpace(creds.Login) || string.IsNullOrWhiteSpace(creds.Password))
{
//Make a failed pw wait