first commit

This commit is contained in:
Vitalii Litvinchuk
2026-06-13 23:23:50 +03:00
commit 23958e8e2c
72 changed files with 6142 additions and 0 deletions
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
namespace SequenceAuth.Example.Controllers;
[ApiController]
[Route("[controller]/[action]")]
public abstract class ApiControllerBase : ControllerBase
{
protected Guid UserId
{
get
{
var options = HttpContext.RequestServices.GetRequiredService<Microsoft.Extensions.Options.IOptions<SequenceAuth.Lib.SequenceAuthOptions>>().Value;
return Guid.Parse(HttpContext.Items[options.UserIdItemKey]?.ToString() ?? throw new UnauthorizedAccessException());
}
}
}