From d083b0a7c556f773cc5dda13ea62cd91a41d162c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Fri, 9 Oct 2020 01:41:02 +0200 Subject: [PATCH] Update the MongoDB token store to use UtcDateTime --- src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs index 210b9fee..605cff42 100644 --- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs +++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbTokenStore.cs @@ -562,7 +562,7 @@ namespace OpenIddict.MongoDb await (from token in collection.AsQueryable() join authorization in database.GetCollection(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)