Skip to content

Commit

Permalink
VCST-888: Customer user type for invited users (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksavosteev committed Jul 25, 2024
1 parent 62a4c6c commit 01d5e6c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace VirtoCommerce.ProfileExperienceApiModule.Data.Commands
{
public class InviteUserCommandHandler : IRequestHandler<InviteUserCommand, IdentityResultResponse>
{
private const string _userType = "Customer";

private readonly IWebHostEnvironment _environment;
private readonly Func<UserManager<ApplicationUser>> _userManagerFactory;
private readonly Func<RoleManager<Role>> _roleManagerFactory;
Expand Down Expand Up @@ -62,7 +64,7 @@ public virtual async Task<IdentityResultResponse> Handle(InviteUserCommand reque
using var userManager = _userManagerFactory();

var contact = CreateContact(request, email);

await _memberService.SaveChangesAsync(new Member[] { contact });

var user = CreateUser(request, contact, email);
Expand Down Expand Up @@ -132,7 +134,8 @@ protected virtual ApplicationUser CreateUser(InviteUserCommand request, Contact
UserName = email,
Email = email,
MemberId = contact.Id,
StoreId = request.StoreId
StoreId = request.StoreId,
UserType = _userType,
};
}

Expand Down

0 comments on commit 01d5e6c

Please sign in to comment.