Skip to content

Commit

Permalink
[framework] user is logged out after role change (#3459)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Sep 25, 2024
1 parent 1ca026a commit f8fe492
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Model/Customer/User/CustomerUserFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,16 @@ public function setDefaultDeliveryAddress(CustomerUser $customerUser, DeliveryAd
public function editCustomerUser(int $id, CustomerUserData $customerUserData): CustomerUser
{
$customerUser = $this->getCustomerUserById($id);
$customerUserOriginalRoles = $customerUser->getRoles();

$customerUser->edit($customerUserData);

$this->em->flush();

if ($this->areRolesChanged($customerUser->getRoles(), $customerUserOriginalRoles)) {
$this->customerUserRefreshTokenChainFacade->removeAllCustomerUserRefreshTokenChains($customerUser);
}

return $customerUser;
}

Expand Down

0 comments on commit f8fe492

Please sign in to comment.