authorization

This commit is contained in:
Aleksandr Popov
2023-06-25 12:39:49 +02:00
parent 4df16b26db
commit 944712df97
6 changed files with 98 additions and 1 deletions
@@ -1,11 +1,16 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace TURN.Services.Chess.Controllers
{
[Authorize(AuthenticationSchemes = AuthSchemes, Roles = "admin")]
[Route("/[controller]")]
[ApiController]
public class TurnController : ControllerBase
{
public const string AuthSchemes = JwtBearerDefaults.AuthenticationScheme;
/// <summary>
/// Тестовый гет.
/// </summary>