feat(api): аутентификация и авторизация. Кастомные ParrAuthenticationHandler и BaseSimpleRoleProvider.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using PARR.API.Contracts.V1;
|
||||
using PARR.API.Contracts.V1.Responses.Base;
|
||||
using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Services.Interfaces;
|
||||
using PARR.Constants;
|
||||
using PARR.DAL.CacheServices;
|
||||
using PARR.DAL.TransformServices;
|
||||
|
||||
@@ -26,13 +28,13 @@ namespace PARR.API.Controllers.V1
|
||||
/// Получить мой ip
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//[Authorize(Roles = ParrRoles.Administrator.Role)]
|
||||
[Authorize]
|
||||
[HttpGet(ApiRoutes.Test.GetMyIp)]
|
||||
public IActionResult GetMyIp()
|
||||
{
|
||||
var ipAddress = clientService.GetClientIp();
|
||||
|
||||
//var ipV4 = ipAddress?.MapToIPv4();
|
||||
|
||||
var ip = ipAddress?.ToString();
|
||||
|
||||
return Ok(new Response<object>(new { ip }, true));
|
||||
|
||||
Reference in New Issue
Block a user