Skip to content

Commit

Permalink
fix bad redirection (dotnet-architecture#608)
Browse files Browse the repository at this point in the history
* fix bad redirection
fix cleanning of local storage on startup

* update all nuget package

* avoid magic string
  • Loading branch information
michelcedric authored Nov 1, 2021
1 parent 5d34222 commit ed30f3d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ApplicationCore/ApplicationCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="3.2.0" />
<PackageReference Include="Ardalis.GuardClauses" Version="3.3.0" />
<PackageReference Include="Ardalis.Specification" Version="5.2.0" />
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="System.Security.Claims" Version="4.3.0" />
Expand Down
10 changes: 6 additions & 4 deletions src/BlazorAdmin/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using BlazorAdmin.Services;
using Blazored.LocalStorage;
using BlazorShared;
using BlazorShared.Models;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
Expand All @@ -27,13 +28,13 @@ public static async Task Main(string[] args)

builder.Services.AddScoped<ToastService>();
builder.Services.AddScoped<HttpService>();

builder.Services.AddBlazoredLocalStorage();

builder.Services.AddAuthorizationCore();
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthStateProvider>();
builder.Services.AddScoped(sp => (CustomAuthStateProvider)sp.GetRequiredService<AuthenticationStateProvider>());

builder.Services.AddBlazorServices();

builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging"));
Expand All @@ -48,7 +49,8 @@ private static async Task ClearLocalStorageCache(IServiceCollection services)
var sp = services.BuildServiceProvider();
var localStorageService = sp.GetRequiredService<ILocalStorageService>();

await localStorageService.RemoveItemAsync("brands");
await localStorageService.RemoveItemAsync(typeof(CatalogBrand).Name);
await localStorageService.RemoveItemAsync(typeof(CatalogType).Name);
}
}
}
2 changes: 1 addition & 1 deletion src/Infrastructure/Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="5.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.11" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/PublicApi/PublicApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />

<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Controllers/ManageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public async Task<IActionResult> SendVerificationEmail(IndexViewModel model)
await _emailSender.SendEmailConfirmationAsync(email, callbackUrl);

StatusMessage = "Verification email sent. Please check your email.";
return RedirectToAction(nameof(Index));
return RedirectToAction(nameof(MyAccount));
}

[HttpGet]
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\fonts\" />
Expand Down

0 comments on commit ed30f3d

Please sign in to comment.