Skip to content

Commit

Permalink
Fixed redirect to login and register page by force loading
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaKamikaze committed Nov 9, 2023
1 parent 8e79cb5 commit a81a077
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ChatRPG/Areas/Identity/Pages/Account/LogOut.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page
@page "/Logout"
@attribute [IgnoreAntiforgeryToken]
@inject SignInManager<IdentityUser> SignInManager
@functions {
Expand Down
2 changes: 1 addition & 1 deletion ChatRPG/Areas/Identity/Pages/Account/Login.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page
@page "/Login"
@using Microsoft.AspNetCore.Authentication
@model LoginModel

Expand Down
2 changes: 1 addition & 1 deletion ChatRPG/Areas/Identity/Pages/Account/Register.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page
@page "/Register"
@using Microsoft.AspNetCore.Authentication
@model RegisterModel
@{
Expand Down
1 change: 0 additions & 1 deletion ChatRPG/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
<Authorized>
<PageTitle>Dashboard - ChatRPG</PageTitle>


</Authorized>
</AuthorizeView>
8 changes: 4 additions & 4 deletions ChatRPG/Shared/LoginDisplay.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</Authorized>
<NotAuthorized>
<div class="btn-group">
<button class="btn btn-secondary" @onclick="Register">Register</button>
<button class="btn btn-secondary" @onclick="Login">Log in</button>
<button @onclick="Register" class="btn btn-secondary">Register</button>
<button @onclick="Login" class="btn btn-secondary">Log in</button>
</div>
</NotAuthorized>
</AuthorizeView>
Expand All @@ -19,11 +19,11 @@
@code {
private void Register()
{
NavMan.NavigateTo("Identity/Account/Register");
NavMan.NavigateTo("Register", forceLoad: true);
}

private void Login()
{
NavMan.NavigateTo("Identity/Account/Login");
NavMan.NavigateTo("Login", forceLoad: true);
}
}

0 comments on commit a81a077

Please sign in to comment.