From 52dfde95d147743b9e99870aee8aefdd2ca12e84 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 7 Mar 2025 14:11:07 +0100 Subject: [PATCH] Tie push subscriptions to current session If a user logs out from a device the expectation should be that device no longer having any association with the user's account. Any existing push notifications should thefore be removed on server. For this reason tie push notifications to a session, and remove them when the session is deleted. --- components/Header.vue | 6 +++--- components/PushNotification.vue | 8 +++++--- server/api/auth/session.get.ts | 11 ++++++++--- server/api/subscribe.post.ts | 9 +++++++-- server/api/unsubscribe.post.ts | 6 +++--- server/utils/session.ts | 12 +++++++++++- shared/types/account.d.ts | 2 ++ 7 files changed, 39 insertions(+), 15 deletions(-) diff --git a/components/Header.vue b/components/Header.vue index a41a5cc..0f87157 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -8,9 +8,9 @@