|
|
|
@ -8,6 +8,7 @@ using System.Text.Json; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using OpenIddict.Abstractions; |
|
|
|
using Volo.Abp.Data; |
|
|
|
using Volo.Abp.Guids; |
|
|
|
@ -29,8 +30,9 @@ public class AbpOpenIddictAuthorizationStore : AbpOpenIddictStoreBase<IOpenIddic |
|
|
|
IOpenIddictApplicationRepository applicationRepository, |
|
|
|
IOpenIddictTokenRepository tokenRepository, |
|
|
|
AbpOpenIddictIdentifierConverter identifierConverter, |
|
|
|
IOpenIddictDbConcurrencyExceptionHandler concurrencyExceptionHandler) |
|
|
|
: base(repository, unitOfWorkManager, guidGenerator, identifierConverter, concurrencyExceptionHandler) |
|
|
|
IOpenIddictDbConcurrencyExceptionHandler concurrencyExceptionHandler, |
|
|
|
IOptions<AbpOpenIddictStoreOptions> storeOptions) |
|
|
|
: base(repository, unitOfWorkManager, guidGenerator, identifierConverter, concurrencyExceptionHandler, storeOptions) |
|
|
|
{ |
|
|
|
ApplicationRepository = applicationRepository; |
|
|
|
TokenRepository = tokenRepository; |
|
|
|
@ -61,7 +63,7 @@ public class AbpOpenIddictAuthorizationStore : AbpOpenIddictStoreBase<IOpenIddic |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.RepeatableRead)) |
|
|
|
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: StoreOptions.Value.DefaultIsolationLevel)) |
|
|
|
{ |
|
|
|
await TokenRepository.DeleteManyByAuthorizationIdAsync(authorization.Id, cancellationToken: cancellationToken); |
|
|
|
|
|
|
|
@ -289,7 +291,7 @@ public class AbpOpenIddictAuthorizationStore : AbpOpenIddictStoreBase<IOpenIddic |
|
|
|
|
|
|
|
public virtual async ValueTask<long> PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: IsolationLevel.RepeatableRead)) |
|
|
|
using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: StoreOptions.Value.DefaultIsolationLevel)) |
|
|
|
{ |
|
|
|
var date = threshold.UtcDateTime; |
|
|
|
var count = await Repository.PruneAsync(date, cancellationToken: cancellationToken); |
|
|
|
|