mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-09-20 01:54:20 +02:00
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using DotBased.Logging;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
using SharpRSS.Business.Services;
|
|
using ILogger = DotBased.Logging.ILogger;
|
|
|
|
namespace SharpRSS.Blazor.Auth;
|
|
|
|
public class SRSSAuthenticationStateProvider : AuthenticationStateProvider
|
|
{
|
|
public SRSSAuthenticationStateProvider(IHttpContextAccessor contextAccessor, AuthService authService)
|
|
{
|
|
_logger = LogService.RegisterLogger(typeof(SRSSAuthenticationStateProvider));
|
|
if (contextAccessor.HttpContext != null)
|
|
_httpContext = contextAccessor.HttpContext;
|
|
else
|
|
{
|
|
var ex = new ApplicationException("HttpContext is null! Cannot setup authentication state provider!");
|
|
_logger.Fatal(ex, "Failed to initialize authentication state provider!");
|
|
throw ex;
|
|
}
|
|
_authService = authService;
|
|
}
|
|
|
|
private readonly ILogger _logger;
|
|
private readonly HttpContext _httpContext;
|
|
private readonly AuthService _authService;
|
|
|
|
public override Task<AuthenticationState> GetAuthenticationStateAsync()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
} |