diff --git a/src/Core/IdentityServer/CustomTokenRequestValidator.cs b/src/Core/IdentityServer/CustomTokenRequestValidator.cs index 1e076af5a2..f190891264 100644 --- a/src/Core/IdentityServer/CustomTokenRequestValidator.cs +++ b/src/Core/IdentityServer/CustomTokenRequestValidator.cs @@ -56,7 +56,7 @@ namespace Bit.Core.IdentityServer { var email = context.Result.ValidatedRequest.Subject?.GetDisplayName() ?? context.Result.ValidatedRequest.ClientClaims?.FirstOrDefault(claim => claim.Type == JwtClaimTypes.Email)?.Value; - var user = await _userManager.FindByEmailAsync(email); + var user = string.IsNullOrWhiteSpace(email) ? null : await _userManager.FindByEmailAsync(email); return (user, user != null); }