Files
WebNovelPortal/WebNovelPortalAPI/Controllers/AuthorizedController.cs
littlefoot ceb8a0db8e
All checks were successful
continuous-integration/drone/push Build is passing
Refactor and novel18 support (added cookie support in general to AbstractScraper.cs
2022-07-20 22:04:13 -04:00

32 lines
710 B
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 Common.Models.DBDomain;
using WebNovelPortalAPI.Middleware;
namespace WebNovelPortalAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class AuthorizedController : ControllerBase
{
protected int UserId
{
get
{
return (int) (HttpContext.Items[EnsureUserCreatedMiddleware.UserIdItemName] ?? 0);
}
}
public AuthorizedController()
{
}
}
}