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/KTUSA PS/Controllers/TestController.cs
Nadegamra a3b4bb2e30 Mostly backend models stuff
Changed some models, did some work on database, created a class diagram.
2021-09-08 20:20:32 +03:00

24 lines
601 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 KTUSA_PS.Controllers
{
[Route("[controller]")]
[Authorize]
[ApiController]
public class TestController : ControllerBase
{
[HttpGet]
public Object[] Index()
{
return this.HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
}
}
}