Approve member when created with built-in macros (#10428)

* Allow members created with built-in macros to be approved

* Cleanup

* Newly created members are always approved like in v8.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Elitsa Marinovska
2021-06-15 13:51:39 +02:00
committed by GitHub
parent c63b14a52e
commit 0c3db013d5
3 changed files with 5 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ namespace Umbraco.Cms.Core.Security
/// <summary>
/// Used to construct a new instance without an identity
/// </summary>
public static MemberIdentityUser CreateNew(string username, string email, string memberTypeAlias, string name = null)
public static MemberIdentityUser CreateNew(string username, string email, string memberTypeAlias, bool isApproved, string name = null)
{
if (string.IsNullOrWhiteSpace(username))
{
@@ -46,6 +46,7 @@ namespace Umbraco.Cms.Core.Security
user.UserName = username;
user.Email = email;
user.MemberTypeAlias = memberTypeAlias;
user.IsApproved = isApproved;
user.Id = null;
user.HasIdentity = false;
user.Name = name;