35 lines
955 B
C#
35 lines
955 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using WebAPI.Data;
|
|
|
|
namespace WebAPI.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class HelloWorldController : BaseController
|
|
{
|
|
private readonly PterodactylService _pterodactylService;
|
|
private readonly OIDCService _oidcService;
|
|
|
|
public HelloWorldController(PterodactylService pterodactylService, OIDCService oidcService)
|
|
{
|
|
_pterodactylService = pterodactylService;
|
|
_oidcService = oidcService;
|
|
}
|
|
|
|
[HttpGet]
|
|
public async Task<string> HelloWorld()
|
|
{
|
|
if (await _oidcService.ValidateAccessToken(BearerToken))
|
|
{
|
|
return "Validated";
|
|
}
|
|
return "Failed";
|
|
}
|
|
|
|
}
|
|
} |