mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
41 lines
940 B
Plaintext
41 lines
940 B
Plaintext
@attribute [Authorize]
|
|
@inherits AuthComponentBase
|
|
|
|
@inject NavigationManager NavManager
|
|
@inject IApplicationConfig AppConfig
|
|
@inject SignInManager<RemotelyUser> SignInManager
|
|
|
|
@if (!string.IsNullOrWhiteSpace(AppConfig.MessageOfTheDay))
|
|
{
|
|
<div class="mr-5">
|
|
<AlertBanner Message="@AppConfig.MessageOfTheDay" StatusClass="info" />
|
|
</div>
|
|
}
|
|
|
|
<AlertsFrame />
|
|
<DevicesFrame />
|
|
<ChatFrame />
|
|
|
|
@code {
|
|
|
|
protected override void OnAfterRender(bool firstRender)
|
|
{
|
|
if (AppConfig.Require2FA && !User.TwoFactorEnabled)
|
|
{
|
|
NavManager.NavigateTo("/TwoFactorRequired");
|
|
}
|
|
base.OnAfterRender(firstRender);
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
|
|
if (IsAuthenticated == true && User is null)
|
|
{
|
|
await SignInManager.SignOutAsync();
|
|
NavManager.NavigateTo("/");
|
|
}
|
|
await base.OnInitializedAsync();
|
|
}
|
|
}
|