Browse Source

Fix the Entity Framework 6.x authorizations/tokens stores to use the FindAsync() method correctly

pull/503/head
Kévin Chalet 9 years ago
parent
commit
8db7c49a43
  1. 2
      src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs
  2. 4
      src/OpenIddict.EntityFramework/Stores/OpenIddictTokenStore.cs

2
src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs

@ -369,7 +369,7 @@ namespace OpenIddict.EntityFramework
// Bind the authorization to the specified application, if applicable.
if (!string.IsNullOrEmpty(descriptor.ApplicationId))
{
var application = await Applications.FindAsync(new object[] { ConvertIdentifierFromString(descriptor.ApplicationId) }, cancellationToken);
var application = await Applications.FindAsync(cancellationToken, ConvertIdentifierFromString(descriptor.ApplicationId));
if (application == null)
{
throw new InvalidOperationException("The application associated with the authorization cannot be found.");

4
src/OpenIddict.EntityFramework/Stores/OpenIddictTokenStore.cs

@ -430,7 +430,7 @@ namespace OpenIddict.EntityFramework
// Bind the token to the specified client application, if applicable.
if (!string.IsNullOrEmpty(descriptor.ApplicationId))
{
var application = await Applications.FindAsync(new object[] { ConvertIdentifierFromString(descriptor.ApplicationId) }, cancellationToken);
var application = await Applications.FindAsync(cancellationToken, ConvertIdentifierFromString(descriptor.ApplicationId));
if (application == null)
{
throw new InvalidOperationException("The application associated with the token cannot be found.");
@ -442,7 +442,7 @@ namespace OpenIddict.EntityFramework
// Bind the token to the specified authorization, if applicable.
if (!string.IsNullOrEmpty(descriptor.AuthorizationId))
{
var authorization = await Authorizations.FindAsync(new object[] { ConvertIdentifierFromString(descriptor.AuthorizationId) }, cancellationToken);
var authorization = await Authorizations.FindAsync(cancellationToken, ConvertIdentifierFromString(descriptor.AuthorizationId));
if (authorization == null)
{
throw new InvalidOperationException("The authorization associated with the token cannot be found.");

Loading…
Cancel
Save