From 3697093df1b111ce71909df89646b1105d39fedb Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sun, 23 Jul 2023 16:22:49 -0700 Subject: [PATCH] Moved AccountController.cs to IdentityController.cs and defined roles on a route --- .../{AccountController.cs => v1/IdentityController.cs} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename Newsbot.Collector.Api/Controllers/{AccountController.cs => v1/IdentityController.cs} (91%) diff --git a/Newsbot.Collector.Api/Controllers/AccountController.cs b/Newsbot.Collector.Api/Controllers/v1/IdentityController.cs similarity index 91% rename from Newsbot.Collector.Api/Controllers/AccountController.cs rename to Newsbot.Collector.Api/Controllers/v1/IdentityController.cs index a0c7d85..ddfd6e7 100644 --- a/Newsbot.Collector.Api/Controllers/AccountController.cs +++ b/Newsbot.Collector.Api/Controllers/v1/IdentityController.cs @@ -6,15 +6,15 @@ using Newsbot.Collector.Api.Domain.Response; using Newsbot.Collector.Api.Domain.Results; using Newsbot.Collector.Api.Services; -namespace Newsbot.Collector.Api.Controllers; +namespace Newsbot.Collector.Api.Controllers.v1; [ApiController] -[Route("/api/account")] -public class AccountController : ControllerBase +[Route("/api/v1/account")] +public class IdentityController : ControllerBase { private IIdentityService _identityService; - public AccountController(IIdentityService identityService) + public IdentityController(IIdentityService identityService) { _identityService = identityService; } @@ -71,7 +71,7 @@ public class AccountController : ControllerBase } [HttpPost("addRole")] - [Authorize(Roles = AuthorizationRoles.Administrators)] + [Authorize(Roles = Authorization.AdministratorsRole)] public ActionResult AddRole([FromBody] AddRoleRequest request) { try