mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
853 B
28 lines
853 B
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Volo.Abp.Application.Services;
|
|
using Volo.Abp.Identity;
|
|
|
|
namespace Volo.Abp.Account
|
|
{
|
|
public class AccountAppService : ApplicationService, IAccountAppService
|
|
{
|
|
protected IdentityUserManager UserManager { get; }
|
|
|
|
public AccountAppService(
|
|
IdentityUserManager userManager)
|
|
{
|
|
UserManager = userManager;
|
|
}
|
|
|
|
public virtual async Task<IdentityUserDto> RegisterAsync(RegisterDto input)
|
|
{
|
|
var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id);
|
|
|
|
(await UserManager.CreateAsync(user, input.Password).ConfigureAwait(false)).CheckErrors();
|
|
|
|
return ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
|
|
}
|
|
}
|
|
}
|