Skip to content

Commit e7b55df

Browse files
authored
Fix blocking call in FindByEmailAsync (#24116)
1 parent 95c3bd5 commit e7b55df

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Identity/EntityFrameworkCore/src/UserStore.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ protected override Task<TUserLogin> FindUserLoginAsync(string loginProvider, str
322322
return UserLogins.SingleOrDefaultAsync(userLogin => userLogin.LoginProvider == loginProvider && userLogin.ProviderKey == providerKey, cancellationToken);
323323
}
324324

325-
326325
/// <summary>
327326
/// Adds the given <paramref name="normalizedRoleName"/> to the specified <paramref name="user"/>.
328327
/// </summary>
@@ -637,7 +636,7 @@ public async override Task<TUser> FindByLoginAsync(string loginProvider, string
637636
cancellationToken.ThrowIfCancellationRequested();
638637
ThrowIfDisposed();
639638

640-
return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault());
639+
return Users.SingleOrDefaultAsync(u => u.NormalizedEmail == normalizedEmail);
641640
}
642641

643642
/// <summary>
@@ -719,7 +718,6 @@ protected override Task AddUserTokenAsync(TUserToken token)
719718
return Task.CompletedTask;
720719
}
721720

722-
723721
/// <summary>
724722
/// Remove a new user token.
725723
/// </summary>

0 commit comments

Comments
 (0)