tidy up how a user is created when invited, ensure the special empty password is used.

This commit is contained in:
Shannon
2017-06-15 00:46:23 +02:00
parent 6d22f7f86f
commit 0858e04345
7 changed files with 48 additions and 41 deletions

View File

@@ -36,11 +36,8 @@ namespace Umbraco.Web.Models.Mapping
}
});
config.CreateMap<UserInvite, IUser>()
.ConstructUsing(invite => new User(invite.Name, invite.Email, invite.Email, Guid.NewGuid().ToString("N")))
.IgnoreAllUnmapped()
//generate a new token
.ForMember(user => user.SecurityStamp, expression => expression.MapFrom(x => (DateTime.Now + x.Email).ToSHA1()))
config.CreateMap<UserInvite, IUser>()
.IgnoreAllUnmapped()
//all invited users will not be approved, completing the invite will approve the user
.ForMember(user => user.IsApproved, expression => expression.UseValue(false))
.AfterMap((invite, user) =>