Browse Source

Fix registration of grant store.

pull/352/head
Sebastian Stehle 7 years ago
parent
commit
944f9f69f3
  1. 12
      src/Squidex/Config/Domain/StoreServices.cs

12
src/Squidex/Config/Domain/StoreServices.cs

@ -6,6 +6,7 @@
// ==========================================================================
using System;
using System.Linq;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
@ -87,9 +88,6 @@ namespace Squidex.Config.Domain
services.AddSingletonAs<MongoHistoryEventRepository>()
.AsOptional<IHistoryEventRepository>();
services.AddSingletonAs<MongoPersistedGrantStore>()
.AsOptional<IPersistedGrantStore>();
services.AddSingletonAs<MongoRoleStore>()
.AsOptional<IRoleStore<IdentityRole>>();
@ -110,6 +108,14 @@ namespace Squidex.Config.Domain
.AsOptional<IContentRepository>()
.AsOptional<ISnapshotStore<ContentState, Guid>>()
.AsOptional<IEventConsumer>();
var registration = services.FirstOrDefault(x => x.ServiceType == typeof(IPersistedGrantStore));
if (registration == null || registration.ImplementationType == typeof(InMemoryPersistedGrantStore))
{
services.AddSingletonAs<MongoPersistedGrantStore>()
.As<IPersistedGrantStore>();
}
}
});

Loading…
Cancel
Save