Browse Source

Update the MongoDB token store to use UtcDateTime

pull/1123/head
Kévin Chalet 5 years ago
parent
commit
d083b0a7c5
  1. 2
      src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs

2
src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs

@ -562,7 +562,7 @@ namespace OpenIddict.MongoDb
await (from token in collection.AsQueryable()
join authorization in database.GetCollection<OpenIddictMongoDbAuthorization>(Options.CurrentValue.AuthorizationsCollectionName).AsQueryable()
on token.AuthorizationId equals authorization.Id into authorizations
where token.CreationDate < threshold
where token.CreationDate < threshold.UtcDateTime
where (token.Status != Statuses.Inactive && token.Status != Statuses.Valid) ||
token.ExpirationDate < DateTime.UtcNow ||
authorizations.Any(authorization => authorization.Status != Statuses.Valid)

Loading…
Cancel
Save