Add checking user status to login sequence where login form is currently
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
@using Moonlight.Shared.Components.ErrorBoundaries
|
@using Moonlight.Shared.Components.ErrorBoundaries
|
||||||
@using Moonlight.Shared.Components.Partials
|
|
||||||
@using Moonlight.Shared.Components.Alerts
|
|
||||||
@using Moonlight.Shared.Components.Auth
|
@using Moonlight.Shared.Components.Auth
|
||||||
@using Moonlight.App.Database.Entities
|
@using Moonlight.App.Database.Entities
|
||||||
@using Moonlight.App.Extensions
|
@using Moonlight.App.Extensions
|
||||||
@@ -8,7 +6,6 @@
|
|||||||
@using Moonlight.App.Services
|
@using Moonlight.App.Services
|
||||||
@using Moonlight.App.Services.Interop
|
@using Moonlight.App.Services.Interop
|
||||||
@using Moonlight.App.Services.Sessions
|
@using Moonlight.App.Services.Sessions
|
||||||
@using Logging.Net
|
|
||||||
@using Moonlight.App.Events
|
@using Moonlight.App.Events
|
||||||
|
|
||||||
@layout ThemeInit
|
@layout ThemeInit
|
||||||
@@ -21,6 +18,7 @@
|
|||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject EventSystem Event
|
@inject EventSystem Event
|
||||||
@inject ToastService ToastService
|
@inject ToastService ToastService
|
||||||
|
@inject SmartTranslateService SmartTranslateService
|
||||||
|
|
||||||
<GlobalErrorBoundary>
|
<GlobalErrorBoundary>
|
||||||
@{
|
@{
|
||||||
@@ -61,6 +59,8 @@
|
|||||||
<div id="kt_app_content_container" class="app-container container-fluid">
|
<div id="kt_app_content_container" class="app-container container-fluid">
|
||||||
<div class="mt-10">
|
<div class="mt-10">
|
||||||
<SoftErrorBoundary>
|
<SoftErrorBoundary>
|
||||||
|
@if (UserProcessed)
|
||||||
|
{
|
||||||
@if (uri.LocalPath != "/login" &&
|
@if (uri.LocalPath != "/login" &&
|
||||||
uri.LocalPath != "/passwordreset" &&
|
uri.LocalPath != "/passwordreset" &&
|
||||||
uri.LocalPath != "/register")
|
uri.LocalPath != "/register")
|
||||||
@@ -108,6 +108,21 @@
|
|||||||
<PasswordReset></PasswordReset>
|
<PasswordReset></PasswordReset>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="modal d-block">
|
||||||
|
<div class="modal-dialog modal-dialog-centered mw-900px">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="pt-2 modal-body py-lg-10 px-lg-10">
|
||||||
|
|
||||||
|
<h2>@(SmartTranslateService.Translate("Authenticating"))...</h2>
|
||||||
|
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Verifying token, loading user data"))</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</SoftErrorBoundary>
|
</SoftErrorBoundary>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -124,6 +139,7 @@
|
|||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
private User? User;
|
private User? User;
|
||||||
|
private bool UserProcessed = false;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
@@ -154,6 +170,7 @@
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
User = await IdentityService.Get();
|
User = await IdentityService.Get();
|
||||||
|
UserProcessed = true;
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-reset-transition");
|
await JsRuntime.InvokeVoidAsync("document.body.removeAttribute", "data-kt-app-reset-transition");
|
||||||
|
|||||||
Reference in New Issue
Block a user