mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
choose other emails when primary not available (#2188)
This commit is contained in:
parent
5cbdee1379
commit
a89bfdfe2b
@ -135,6 +135,11 @@ namespace Bit.Scim.Controllers.v2
|
|||||||
email = model.UserName?.ToLowerInvariant();
|
email = model.UserName?.ToLowerInvariant();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
email = model.WorkEmail?.ToLowerInvariant();
|
||||||
|
if (string.IsNullOrWhiteSpace(email))
|
||||||
|
{
|
||||||
|
email = model.Emails?.FirstOrDefault()?.Value?.ToLowerInvariant();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ namespace Bit.Scim.Models
|
|||||||
public NameModel Name { get; set; }
|
public NameModel Name { get; set; }
|
||||||
public List<EmailModel> Emails { get; set; }
|
public List<EmailModel> Emails { get; set; }
|
||||||
public string PrimaryEmail => Emails?.FirstOrDefault(e => e.Primary)?.Value;
|
public string PrimaryEmail => Emails?.FirstOrDefault(e => e.Primary)?.Value;
|
||||||
|
public string WorkEmail => Emails?.FirstOrDefault(e => e.Type == "work")?.Value;
|
||||||
public string DisplayName { get; set; }
|
public string DisplayName { get; set; }
|
||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
public List<string> Groups { get; set; }
|
public List<string> Groups { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user