40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Newtonsoft.Json;
|
|
using WebAPI.Auth;
|
|
using WebAPI.Data;
|
|
|
|
namespace WebAPI.Controllers
|
|
{
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class HelloWorldController : BaseController
|
|
{
|
|
private readonly PterodactylService _pterodactylService;
|
|
|
|
public HelloWorldController(PterodactylService pterodactylService)
|
|
{
|
|
_pterodactylService = pterodactylService;
|
|
}
|
|
|
|
[HttpGet]
|
|
public async Task<string> HelloWorld()
|
|
{
|
|
return JsonConvert.SerializeObject(User.Claims.Select(claim => new {claim.Type, claim.Value}));
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("NameRequired")]
|
|
public string NameRequired()
|
|
{
|
|
return "success";
|
|
}
|
|
|
|
}
|
|
} |