1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

Fix null email parameter from missing email claim (#993)

This commit is contained in:
Chad Scharf
2020-11-13 11:26:05 -05:00
committed by GitHub
parent fefa0e2dea
commit 80f2bf9260

View File

@ -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);
}