mirror of https://github.com/ErsatzTV/ErsatzTV.git
8 changed files with 177 additions and 62 deletions
@ -1,11 +1,13 @@
@@ -1,11 +1,13 @@
|
||||
<Router AppAssembly="@typeof(Program).Assembly"> |
||||
<Found Context="routeData"> |
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/> |
||||
</Found> |
||||
<NotFound> |
||||
<PageTitle>Not found</PageTitle> |
||||
<LayoutView Layout="@typeof(MainLayout)"> |
||||
<p role="alert">Sorry, there's nothing at this address.</p> |
||||
</LayoutView> |
||||
</NotFound> |
||||
</Router> |
||||
<CascadingAuthenticationState> |
||||
<Router AppAssembly="@typeof(Program).Assembly"> |
||||
<Found Context="routeData"> |
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/> |
||||
</Found> |
||||
<NotFound> |
||||
<PageTitle>Not found</PageTitle> |
||||
<LayoutView Layout="@typeof(MainLayout)"> |
||||
<p role="alert">Sorry, there's nothing at this address.</p> |
||||
</LayoutView> |
||||
</NotFound> |
||||
</Router> |
||||
</CascadingAuthenticationState> |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Mvc; |
||||
|
||||
namespace ErsatzTV.Controllers; |
||||
|
||||
[ApiController] |
||||
public class AccountController : ControllerBase |
||||
{ |
||||
[HttpPost("account/logout")] |
||||
public IActionResult Logout() |
||||
{ |
||||
return new SignOutResult(new[] { "oidc", "cookie" }); |
||||
} |
||||
} |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
namespace ErsatzTV; |
||||
|
||||
public static class OidcHelper |
||||
{ |
||||
public static void Init(IConfiguration configuration) |
||||
{ |
||||
Authority = configuration["OIDC:Authority"]; |
||||
ClientId = configuration["OIDC:ClientId"]; |
||||
ClientSecret = configuration["OIDC:ClientSecret"]; |
||||
|
||||
IsEnabled = !string.IsNullOrWhiteSpace(Authority) && |
||||
!string.IsNullOrWhiteSpace(ClientId) && |
||||
!string.IsNullOrWhiteSpace(ClientSecret); |
||||
} |
||||
|
||||
public static string Authority { get; private set; } |
||||
public static string ClientId { get; private set; } |
||||
public static string ClientSecret { get; private set; } |
||||
public static bool IsEnabled { get; private set; } |
||||
} |
||||
Loading…
Reference in new issue