I have read some solutions regarding similar requests but none have worked for me and I have no idea which way to go.
I'm using ASP.Net Core 3.0, my Blazor application includes the standard authentication option ticked on creation and all I wish to do is the following:
In my "MainLayout.razor" component page I have set the following:
<AuthorizeView>
<Authorized>
<!--Navbar, APP Body and Footer configuration HTML which works -->
</Authorized>
<NotAuthorized>
<!--Simple button that gets displayed and on click goes to the login page-->
<button onclick="location.href = 'Identity/Account/Login';" class="btn btn-primary">Enter</button>
</NotAuthorized>
</AuthorizeView>
I would like to instead of having to click that button have the process automated so that it navigates to that page when a user is not authorized automatically.
Is this possible as I have tried multiple ways of Navigation Manager and Startup configs but can't seem to just get the routing going.
The head of the "Identity/Account/Login" page I have set to " @Page "/Account/Login" ".
If I simply open my browser and just add "...com/Account/Login " to the URL end it directs to the correct page, I believe this should be something simple but I can't seem to figure it out.
Any help would be much appreciated.
Thanks.