// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Squidex.Infrastructure; using Squidex.Shared.Users; namespace Squidex.Domain.Users { public interface IUserService { Task> QueryAsync(IEnumerable ids); Task> QueryAsync(string? query = null, int take = 10, int skip = 0); string GetUserId(ClaimsPrincipal user); Task> GetLoginsAsync(IUser user); Task HasPasswordAsync(IUser user); Task IsEmptyAsync(); Task CreateAsync(string email, UserValues? values = null, bool lockAutomatically = false); Task GetAsync(ClaimsPrincipal principal); Task FindByEmailAsync(string email); Task FindByIdAsync(string id); Task FindByLoginAsync(string provider, string key); Task SetPasswordAsync(string id, string password, string? oldPassword = null); Task AddLoginAsync(string id, ExternalLoginInfo externalLogin); Task RemoveLoginAsync(string id, string loginProvider, string providerKey); Task LockAsync(string id); Task UnlockAsync(string id); Task UpdateAsync(string id, UserValues values, bool silent = false); Task DeleteAsync(string id); } }