Fix blocking call in FindByEmailAsync (#24116)

This commit is contained in:
Hao Kung 2020-07-22 15:04:33 -07:00 committed by GitHub
parent 95c3bd5426
commit e7b55df6c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -322,7 +322,6 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore
return UserLogins.SingleOrDefaultAsync(userLogin => userLogin.LoginProvider == loginProvider && userLogin.ProviderKey == providerKey, cancellationToken);
}
/// <summary>
/// Adds the given <paramref name="normalizedRoleName"/> to the specified <paramref name="user"/>.
/// </summary>
@ -637,7 +636,7 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault());
return Users.SingleOrDefaultAsync(u => u.NormalizedEmail == normalizedEmail);
}
/// <summary>
@ -719,7 +718,6 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore
return Task.CompletedTask;
}
/// <summary>
/// Remove a new user token.
/// </summary>