hack to get Passkeys working

This commit is contained in:
sbwalker
2025-10-22 16:39:52 -04:00
parent ac9b7a60fd
commit cf3a86dc4a
2 changed files with 10 additions and 5 deletions

View File

@ -84,11 +84,7 @@ namespace Microsoft.Extensions.DependencyInjection
options.Cookie.HttpOnly = true; options.Cookie.HttpOnly = true;
}); });
services.AddIdentityCore<IdentityUser>(options => services.AddIdentityCore<IdentityUser>(options => { })
{
// must be set prior to AddEntityFrameworkStores
options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
})
.AddEntityFrameworkStores<TenantDBContext>() .AddEntityFrameworkStores<TenantDBContext>()
.AddSignInManager() .AddSignInManager()
.AddDefaultTokenProviders() .AddDefaultTokenProviders()

View File

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Oqtane.Databases.Interfaces; using Oqtane.Databases.Interfaces;
using Oqtane.Extensions; using Oqtane.Extensions;
using Oqtane.Infrastructure; using Oqtane.Infrastructure;
@ -42,6 +43,14 @@ namespace Oqtane.Repository
{ {
optionsBuilder.ReplaceService<IMigrationsAssembly, MultiDatabaseMigrationsAssembly>(); optionsBuilder.ReplaceService<IMigrationsAssembly, MultiDatabaseMigrationsAssembly>();
// specify the SchemaVersion for .NET Identity as it is not being persisted when using AddIdentityCore()
var services = new ServiceCollection();
services.AddIdentityCore<IdentityUser>(options =>
{
options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
});
optionsBuilder.UseApplicationServiceProvider(services.BuildServiceProvider());
if (string.IsNullOrEmpty(_connectionString)) if (string.IsNullOrEmpty(_connectionString))
{ {
Tenant tenant = _tenantManager.GetTenant(); Tenant tenant = _tenantManager.GetTenant();