diff --git a/sources/Clients.Admin/Components/Pages/Authentications/Login.razor b/sources/Clients.Admin/Components/Pages/Authentications/Login.razor index 47aff6c..14707dc 100644 --- a/sources/Clients.Admin/Components/Pages/Authentications/Login.razor +++ b/sources/Clients.Admin/Components/Pages/Authentications/Login.razor @@ -18,11 +18,18 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { - if (firstRender) + if (!firstRender) { - await AuthenticationManager.LoginFromSessionAsync(); - StateHasChanged(); + return; } + + var result = await AuthenticationManager.LoginFromSessionAsync(); + if (result.IsSuccess) + { + NavigationManager.NavigateTo("/AuthenticationTest"); + } + + StateHasChanged(); } private async Task TryLogin() diff --git a/sources/Clients.Admin/Components/Pages/Authentications/Logout.razor b/sources/Clients.Admin/Components/Pages/Authentications/Logout.razor index 776ce5c..ac233d2 100644 --- a/sources/Clients.Admin/Components/Pages/Authentications/Logout.razor +++ b/sources/Clients.Admin/Components/Pages/Authentications/Logout.razor @@ -9,11 +9,13 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { - if (firstRender) + if (!firstRender) { - await AuthenticationManager.LogoutAsync(); - StateHasChanged(); + return; } + + await AuthenticationManager.LogoutAsync(); + StateHasChanged(); } } \ No newline at end of file