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;

View File

@@ -1,17 +0,0 @@
using DigitalData.Core.API;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.GeneratorAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class EnvelopeController : BasicCRUDControllerBase<IEnvelopeService, EnvelopeDto, Envelope, int>
{
public EnvelopeController(ILogger<EnvelopeController> logger, IEnvelopeService service) : base(logger, service)
{
}
}
}

View File

@@ -2,8 +2,6 @@
using EnvelopeGenerator.Application.Contracts;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using System.DirectoryServices.Protocols;
namespace EnvelopeGenerator.GeneratorAPI.Controllers
{