mirror of
https://github.com/bitwarden/server.git
synced 2024-11-28 13:15:12 +01:00
Fix null email parameter from missing email claim (#993)
This commit is contained in:
parent
fefa0e2dea
commit
80f2bf9260
@ -56,7 +56,7 @@ namespace Bit.Core.IdentityServer
|
|||||||
{
|
{
|
||||||
var email = context.Result.ValidatedRequest.Subject?.GetDisplayName()
|
var email = context.Result.ValidatedRequest.Subject?.GetDisplayName()
|
||||||
?? context.Result.ValidatedRequest.ClientClaims?.FirstOrDefault(claim => claim.Type == JwtClaimTypes.Email)?.Value;
|
?? 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);
|
return (user, user != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user