Prevent double activation potential with createWithRoles* methods

Signed-off-by: 's avatarMicheal Mand <micheal@kmdwebdesigns.com>
parent 57e2caaa
......@@ -68,15 +68,11 @@ class SentinelUserRepository implements UserRepository
public function createWithRoles($data, $roles, $activated = false)
{
$this->hashPassword($data);
$user = $this->create((array) $data);
$user = $this->create((array) $data, $activated);
if (!empty($roles)) {
$user->roles()->attach($roles);
}
if ($activated) {
$this->activateUser($user);
}
}
/**
......@@ -90,16 +86,12 @@ class SentinelUserRepository implements UserRepository
public function createWithRolesFromCli($data, $roles, $activated = false)
{
$this->hashPassword($data);
$user = $this->user->create((array) $data);
$user = $this->user->create((array) $data, $activated);
if (!empty($roles)) {
$user->roles()->attach($roles);
}
if ($activated) {
$this->activateUser($user);
}
return $user;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment