public async Task SetPhoneNumberConfirmedAsync(User user, bool confirmed, CancellationToken cancellationToken) { user.PhoneNumberConfirmed = confirmed; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task SetNormalizedEmailAsync(User user, string normalizedEmail, CancellationToken cancellationToken) { user.NormalizedEmail = normalizedEmail; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task SetPhoneNumberAsync(User user, string phoneNumber, CancellationToken cancellationToken) { user.PhoneNumber = phoneNumber; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task AddLoginAsync(User user, UserLoginInfo login, CancellationToken cancellationToken) { user.Logins.Add(login); if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task SetPasswordHashAsync(User user, string passwordHash, CancellationToken cancellationToken) { user.PasswordHash = passwordHash; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task RemoveLoginAsync(User user, string loginProvider, string providerKey, CancellationToken cancellationToken) { user.Logins.Remove(user.Logins.Single(l => l.ProviderKey == providerKey)); if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task <IdentityResult> UpdateAsync(User user, CancellationToken cancellationToken) { if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } return(IdentityResult.Success); }
public async Task SetUserNameAsync(User user, string userName, CancellationToken cancellationToken) { user.Username = userName; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task SetEmailConfirmedAsync(CloudyUser user, bool confirmed, CancellationToken cancellationToken) { user.EmailConfirmed = confirmed; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task SetEmailAsync(CloudyUser user, string email, CancellationToken cancellationToken) { user.Email = email; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task SetNormalizedUserNameAsync(CloudyUser user, string normalizedName, CancellationToken cancellationToken) { user.NormalizedUsername = normalizedName; if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task AddClaimsAsync(User user, IEnumerable <Claim> claims, CancellationToken cancellationToken) { if (user.Claims == null) { user.Claims = new List <Claim>(); } user.Claims.AddRange(claims); if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task RemoveClaimsAsync(User user, IEnumerable <Claim> claims, CancellationToken cancellationToken) { if (user.Claims == null) { user.Claims = new List <Claim>(); } var types = claims.Select(c => c.Type); user.Claims.RemoveAll(c => types.Contains(c.Type)); if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }
public async Task ReplaceClaimAsync(User user, Claim claim, Claim newClaim, CancellationToken cancellationToken) { if (user.Claims == null) { user.Claims = new List <Claim>(); } var existing = user.Claims.SingleOrDefault(c => c.Type == claim.Type); if (existing != null) { user.Claims.Remove(existing); } user.Claims.Add(newClaim); if (user.Id != null) { await ContainerSpecificContentUpdater.UpdateAsync(user, Container); } }