This repository has been archived on 2025-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
Files
KTUSA-PS/KTUSAPS/Controllers/TestController.cs
Karolis Kundrotas c3bb8983ef Rename and fixes
2021-09-10 11:59:34 +03:00

27 lines
664 B
C#

using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace KTUSAPS.Controllers
{
[Route("[controller]")]
[Authorize]
[ApiController]
public class TestController : ControllerBase
{
[HttpGet]
public object[] Index()
{
return HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
}
[HttpGet("authed")]
public bool IsAuthed() => true;
}
}