graphql-authentication icon indicating copy to clipboard operation
graphql-authentication copied to clipboard

Fix for the issue #112

Open Stalex89 opened this issue 3 years ago • 0 comments

Fix for the issue #112

In Craft 4.* User element has active Boolean set to false by default (source)

This way currently in the create function of UserServiceactive flag is changed to true only in case if ($social && $skipSocialActivation) condition returns true.

I've added the following changes:

  1. set the default active value to true:
      $user = new User();
      $user->username = $email;
      $user->email = $email;
      $user->active = true;
  1. when if ($requiresVerification || $suspendByDefault) condition is true, set the active flag back to false:
if ($requiresVerification || $suspendByDefault) {
      $user->active = false;
      $user->pending = true;
}

Hope that resolves the issue (in my case it does)

Stalex89 avatar Oct 31 '22 10:10 Stalex89