@using Microsoft.AspNetCore.Components @inject NavigationManager Navigation @code { protected override void OnInitialized() { //This auto redirects a user to the login page Navigation.NavigateTo("Account/Login", true); } }