Added EnvelopeReceiverService to web client application.

This commit is contained in:
Developer 02
2024-06-18 11:09:13 +02:00
parent c0a6103eb2
commit cc3f6efbd7
17 changed files with 108 additions and 37 deletions

View File

@@ -31,6 +31,7 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
}
//TODO: When a user group is created for signFlow, add a process to check if the user is in this group (like "PM_USER")
[AllowAnonymous]
[HttpPost("login")]
public async Task<IActionResult> Login([FromBody] LogInDto login)
{
@@ -39,13 +40,13 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
bool isValid = _dirSearchService.ValidateCredentials(login.Username, login.Password);
if (!isValid)
return Unauthorized(Result.Fail().Message(_localizer[Key.UserNotFound]));
return Unauthorized();
//find the user
var uRes = await _userService.ReadByUsernameAsync(login.Username);
if (!uRes.IsSuccess || uRes.Data is null)
{
return Unauthorized(uRes);
return Forbid();
}
UserReadDto user = uRes.Data;