Skip to content

Commit 860a85e

Browse files
committed
Fixes #3.
1 parent 66d291c commit 860a85e

5 files changed

Lines changed: 5 additions & 11 deletions

File tree

CashFlowAnalyzer.Client/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ service of type 'CashFlowAnalyzer.Client.Services.AccountService'. *@
4444
private async Task Logout()
4545
{
4646
await AccountService.Logout();
47-
Navigation.NavigateTo("/Identity/Account/Login");
47+
Navigation.NavigateTo("/Login");
4848
}
4949
} *@

CashFlowAnalyzer.Client/Pages/Security/Login.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/Identity/Account/Login"
1+
@page "/Login"
22
@* custom loginForm paths issue: *@
33
@* https://github.com/dotnet/aspnetcore/issues/58811 *@
44
@using CashFlowAnalyzer.Client.Services

CashFlowAnalyzer.Client/Pages/Security/Register.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
var result = await AccountService.Register(registerModel);
5656
if (result.Success)
5757
{
58-
Navigation.NavigateTo($"/Identity/Account/Login?returnUrl={returnUrl}");
58+
Navigation.NavigateTo($"/Login?returnUrl={returnUrl}");
5959
}
6060
else
6161
{

CashFlowAnalyzer.Client/Program.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,4 @@
1919
// Supply HttpClient instances that include access tokens when making requests to the server project
2020
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("CashFlowAnalyzer.ServerAPI"));
2121

22-
builder.Services.AddApiAuthorization(options =>
23-
{
24-
// https://github.com/dotnet/AspNetCore.Docs/blob/b1e1428d5899fda009f65e2c4e41dac6a60df7b6/aspnetcore/blazor/security/webassembly/additional-scenarios.md#customize-app-routes
25-
// doesn't work because of auto interactivity, see https://github.com/dotnet/aspnetcore/issues/58811
26-
options.AuthenticationPaths.LogInPath = "security/login";
27-
options.AuthenticationPaths.RegisterPath = "security/register";
28-
});
29-
3022
await builder.Build().RunAsync();

CashFlowAnalyzer/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
options.Cookie.SameSite = SameSiteMode.Lax;
2929
options.ExpireTimeSpan = TimeSpan.FromDays(14);
3030
options.SlidingExpiration = true;
31+
options.LoginPath = "/Login";
32+
options.LogoutPath = "/Logout";
3133
});
3234

3335
builder.Services.AddControllers();

0 commit comments

Comments
 (0)