From 8c9b74adce01df8d9c158ac3f1e04f5dde6ea97c Mon Sep 17 00:00:00 2001 From: BentiGorlich Date: Thu, 15 Aug 2024 21:02:26 +0200 Subject: [PATCH] Fix UserPushSubscriptionManager using wrong AccessToken type (#1033) --- src/Controller/Api/Notification/NotificationPushApi.php | 2 +- src/Service/Notification/UserPushSubscriptionManager.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/Api/Notification/NotificationPushApi.php b/src/Controller/Api/Notification/NotificationPushApi.php index b210c9436..56c4ceab6 100644 --- a/src/Controller/Api/Notification/NotificationPushApi.php +++ b/src/Controller/Api/Notification/NotificationPushApi.php @@ -158,7 +158,7 @@ public function deleteSubscription( try { $conn = $this->entityManager->getConnection(); $stmt = $conn->prepare('DELETE FROM user_push_subscription WHERE user_id = :user AND api_token = :token'); - $stmt->executeQuery(['user' => $user, 'token' => $apiToken]); + $stmt->executeQuery(['user' => $user->getId(), 'token' => $apiToken]); return new JsonResponse(headers: $headers); } catch (\Exception $e) { diff --git a/src/Service/Notification/UserPushSubscriptionManager.php b/src/Service/Notification/UserPushSubscriptionManager.php index 5d39a9926..d77f2da18 100644 --- a/src/Service/Notification/UserPushSubscriptionManager.php +++ b/src/Service/Notification/UserPushSubscriptionManager.php @@ -10,7 +10,7 @@ use App\Repository\SiteRepository; use App\Repository\UserPushSubscriptionRepository; use App\Service\SettingsManager; -use League\Bundle\OAuth2ServerBundle\Entity\AccessToken; +use League\Bundle\OAuth2ServerBundle\Model\AccessToken; use Minishlink\WebPush\MessageSentReport; use Minishlink\WebPush\Subscription; use Minishlink\WebPush\WebPush;