mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
@attribute [Authorize]
|
|
@inherits AuthComponentBase
|
|
|
|
@inject NavigationManager NavManager
|
|
@inject IDataService DataService
|
|
@inject SignInManager<RemotelyUser> SignInManager
|
|
|
|
@if (!string.IsNullOrWhiteSpace(_settings?.MessageOfTheDay))
|
|
{
|
|
<div class="me-5">
|
|
<AlertBanner Message="@_settings?.MessageOfTheDay" StatusClass="info" />
|
|
</div>
|
|
}
|
|
|
|
<AlertsFrame />
|
|
<DevicesFrame />
|
|
<ChatFrame />
|
|
|
|
@code {
|
|
private SettingsModel? _settings;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
_settings = await DataService.GetSettings();
|
|
await base.OnInitializedAsync();
|
|
|
|
var isAuthenticated = await AuthService.IsAuthenticated();
|
|
var userResult = await AuthService.GetUser();
|
|
// This handles a weird edge case when the user has been
|
|
// deleted but still has an authentication cookie in their
|
|
// browser.
|
|
if (isAuthenticated == true && !userResult.IsSuccess)
|
|
{
|
|
await SignInManager.SignOutAsync();
|
|
NavManager.NavigateTo("/");
|
|
}
|
|
}
|
|
}
|