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

@@ -274,8 +274,31 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
///
/// </summary>
/// <param name="acceptCode"></param>
/// <returns>HTTP 204 No Content result code on success or fail code with explanation</returns>
[AllowAnonymous]
[HttpPost("lc")]
[ApiExplorerSettings(IgnoreApi = true)]
public async Task<IActionResult> lc([FromBody] string acceptCode)
{
//END USER LICENSE AGREEMENT ROUTE ONLY CALLED FROM WEBAPP AND HIDDEN FROM VIEW AS A ROUTE
//SuperUser only and must have accept code
if (string.IsNullOrWhiteSpace(acceptCode) || acceptCode.ToLowerInvariant() != "iaccepttheagreement")
return StatusCode(403, new ApiNotAuthorizedResponse());
await Core.License.FlagEULA(ct, log);
//Log
await EventLogProcessor.LogEventToDatabaseAsync(new Event(1, 0, AyaType.Global, AyaEvent.Modified, "End user license agreement consent obtained"), ct);
return NoContent();
}
//------------------------------------------------------