CodeLiturgy.Dashboard/BlueWest.Api/Controllers/ApplicationController.cs

23 lines
800 B
C#
Raw Normal View History

2022-09-17 22:13:35 +03:00
using System;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
namespace BlueWest.WebApi.Controllers;
[ApiController]
[Route("application")]
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
[Authorize(AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)]
[EnableCors(Constants.CorsPolicyName)]
2022-09-19 05:50:15 +03:00
[ServiceFilter(typeof(SessionAuthorizationFilter))]
2022-09-17 22:13:35 +03:00
public class ApplicationController : ControllerBase
{
[HttpGet]
[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
public ContentResult GetTimeTicks() => Content(
DateTime.Now.Ticks.ToString());
}