features/api-cleanup #15
@ -1,10 +1,10 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newsbot.Collector.Api.Domain;
|
using Newsbot.Collector.Api.Domain;
|
||||||
using Newsbot.Collector.Api.Domain.Requests;
|
using Newsbot.Collector.Domain.Requests;
|
||||||
using Newsbot.Collector.Api.Domain.Response;
|
using Newsbot.Collector.Domain.Response;
|
||||||
using Newsbot.Collector.Api.Domain.Results;
|
using Newsbot.Collector.Domain.Results;
|
||||||
using Newsbot.Collector.Api.Services;
|
using Newsbot.Collector.Services;
|
||||||
|
|
||||||
namespace Newsbot.Collector.Api.Controllers.v1;
|
namespace Newsbot.Collector.Api.Controllers.v1;
|
||||||
|
|
||||||
@ -12,11 +12,13 @@ namespace Newsbot.Collector.Api.Controllers.v1;
|
|||||||
[Route("/api/v1/account")]
|
[Route("/api/v1/account")]
|
||||||
public class IdentityController : ControllerBase
|
public class IdentityController : ControllerBase
|
||||||
{
|
{
|
||||||
private IIdentityService _identityService;
|
private readonly ILogger<IdentityController> _logger;
|
||||||
|
private readonly IIdentityService _identityService;
|
||||||
|
|
||||||
public IdentityController(IIdentityService identityService)
|
public IdentityController(IIdentityService identityService, ILogger<IdentityController> logger)
|
||||||
{
|
{
|
||||||
_identityService = identityService;
|
_identityService = identityService;
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("register")]
|
[HttpPost("register")]
|
||||||
@ -81,6 +83,7 @@ public class IdentityController : ControllerBase
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
_logger.LogWarning(ex, "Failed to add role to user");
|
||||||
return new BadRequestResult();
|
return new BadRequestResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user