diff --git a/src/model/User/UnclaimedUser.php b/src/model/User/UnclaimedUser.php index b3955a4..92c2663 100644 --- a/src/model/User/UnclaimedUser.php +++ b/src/model/User/UnclaimedUser.php @@ -38,13 +38,16 @@ class UnclaimedUser private $usersRepository; + private $userData; + public function __construct( AccessTokensRepository $accessTokensRepository, DataProviderManager $dataProviderManager, Emitter $emitter, UserManager $userManager, UserMetaRepository $userMetaRepository, - UsersRepository $usersRepository + UsersRepository $usersRepository, + UserData $userData ) { $this->userManager = $userManager; $this->userMetaRepository = $userMetaRepository; @@ -52,6 +55,7 @@ public function __construct( $this->accessTokensRepository = $accessTokensRepository; $this->emitter = $emitter; $this->usersRepository = $usersRepository; + $this->userData = $userData; } /** @@ -123,6 +127,7 @@ public function claimUser(IRow $unclaimedUser, IRow $loggedUser, IRow $deviceTok $this->userMetaRepository->add($unclaimedUser, self::CLAIMED_BY_KEY, $loggedUser->id); $this->userMetaRepository->add($loggedUser, self::CLAIMED_UNCLAIMED_USER_KEY, $unclaimedUser->id); + $this->userData->refreshUserTokens($loggedUser->id); $this->emitter->emit(new UserClaimedEvent($unclaimedUser, $loggedUser, $deviceToken)); }