Fixes issue with deleting external logins, fixes issue with saving new user logins when creating a new user, fixes issue of not checking if the linked login is already linked.

This commit is contained in:
Shannon
2020-09-23 15:45:58 +10:00
parent e6e7917b0c
commit 7fc4364b52
6 changed files with 70 additions and 40 deletions

View File

@@ -275,16 +275,23 @@ namespace Umbraco.Core.Models.Identity
{
get
{
if (_getLogins != null && _getLogins.IsValueCreated == false)
// return if it exists
if (_logins != null) return _logins;
_logins = new ObservableCollection<IIdentityUserLogin>();
// if the callback is there and hasn't been created yet then execute it and populate the logins
if (_getLogins != null && !_getLogins.IsValueCreated)
{
_logins = new ObservableCollection<IIdentityUserLogin>();
foreach (var l in _getLogins.Value)
{
_logins.Add(l);
}
//now assign events
_logins.CollectionChanged += Logins_CollectionChanged;
}
//now assign events
_logins.CollectionChanged += Logins_CollectionChanged;
return _logins;
}
}