Browse Source

Remove cors

jkotalik/newVotingSample
Justin Kotalik 6 years ago
parent
commit
1346f90bf5
  1. 4
      samples/voting/IdentityServer/Startup.cs
  2. 6
      samples/voting/results/Startup.cs
  3. 13
      samples/voting/results/results.csproj

4
samples/voting/IdentityServer/Startup.cs

@ -33,10 +33,6 @@ namespace IdentityServer
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
services.AddSingleton<DefaultCorsPolicyService>((sp) =>
{
return new DefaultCorsPolicyService(sp.GetRequiredService<ILogger<DefaultCorsPolicyService>>()){AllowAll = true};
});
var builder = services.AddIdentityServer(options =>
{

6
samples/voting/results/Startup.cs

@ -24,8 +24,6 @@ namespace Results
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddCors();
JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
services.AddAuthentication(options =>
@ -57,10 +55,6 @@ namespace Results
}
app.UseStaticFiles();
app.UseCors(builder =>
{
builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin();
});
app.UseRouting();
app.UseAuthentication();

13
samples/voting/results/results.csproj

@ -19,17 +19,4 @@
<ProjectReference Include="$(TyeLibrariesPath)\Microsoft.Tye.Extensions.Configuration\Microsoft.Tye.Extensions.Configuration.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" />
</ItemGroup>
</Project>

Loading…
Cancel
Save