Skip to content

Commit 587e051

Browse files
committed
Upgrade to v8.1
1 parent 4a61d85 commit 587e051

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

MyApp/Configure.Auth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public void Configure(IWebHostBuilder builder) => builder
1111
.ConfigureServices((context, services) =>
1212
{
1313
services.AddPlugin(new AuthFeature(IdentityAuth.For<ApplicationUser>(options => {
14-
options.EnableCredentialsAuth = true;
14+
options.CredentialsAuth();
1515
options.SessionFactory = () => new CustomUserSession();
1616
})));
1717
});

MyApp/Configure.AutoQuery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public void Configure(IWebHostBuilder builder) => builder
1111
.ConfigureServices(services => {
1212
// Enable Audit History
1313
services.AddSingleton<ICrudEvents>(c =>
14-
new OrmLiteCrudEvents(c.Resolve<IDbConnectionFactory>()));
14+
new OrmLiteCrudEvents(c.GetRequiredService<IDbConnectionFactory>()));
1515
services.AddPlugin(new AutoQueryDataFeature());
1616
services.AddPlugin(new AutoQueryFeature
1717
{

MyApp/Configure.Cors.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[assembly: HostingStartup(typeof(MyApp.ConfigureCors))]
2+
3+
namespace MyApp;
4+
5+
public class ConfigureCors : IHostingStartup
6+
{
7+
public void Configure(IWebHostBuilder builder) => builder
8+
.ConfigureServices(services =>
9+
{
10+
services.AddCors(options => {
11+
options.AddDefaultPolicy(policy => {
12+
policy.WithOrigins([
13+
"http://localhost:5000", "https://localhost:5001", "http://localhost:8080",
14+
"https://localhost:5173", "http://localhost:5173",
15+
"http://run.plnkr.co", "http://null.jsbin.com",
16+
])
17+
.AllowCredentials()
18+
.WithHeaders(["Content-Type", "Allow", "Authorization"])
19+
.SetPreflightMaxAge(TimeSpan.FromHours(1));
20+
});
21+
});
22+
});
23+
}

MyApp/MyApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<ItemGroup>
2727
<PackageReference Include="ServiceStack" Version="8.*" />
28-
<PackageReference Include="ServiceStack.AspNetCore.OpenApi" Version="8.0.1" />
28+
<PackageReference Include="ServiceStack.AspNetCore.OpenApi" Version="8.*" />
2929
<PackageReference Include="ServiceStack.Blazor" Version="8.*" />
3030
<PackageReference Include="ServiceStack.Mvc" Version="8.*" />
3131
<PackageReference Include="ServiceStack.OrmLite.Sqlite.Data" Version="8.*" />

0 commit comments

Comments
 (0)