From e5ff8d8445668eb2bcd1e9fa38a2d0041b6ca678 Mon Sep 17 00:00:00 2001
From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sat, 28 Oct 2023 07:54:06 +0900
Subject: enhance: プラグイン削除時にアクセストークンも削除する (#12167)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* (enhance) プラグイン削除時にトークンも削除

* update changelog
---
 packages/frontend/src/pages/settings/plugin.vue | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/pages/settings/plugin.vue')

diff --git a/packages/frontend/src/pages/settings/plugin.vue b/packages/frontend/src/pages/settings/plugin.vue
index 4a2d8d600e..d72d8d00f3 100644
--- a/packages/frontend/src/pages/settings/plugin.vue
+++ b/packages/frontend/src/pages/settings/plugin.vue
@@ -77,9 +77,11 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
 
 const plugins = ref(ColdDeviceStorage.get('plugins'));
 
-function uninstall(plugin) {
+async function uninstall(plugin) {
 	ColdDeviceStorage.set('plugins', plugins.value.filter(x => x.id !== plugin.id));
-	os.success();
+	await os.apiWithDialog('i/revoke-token', {
+		token: plugin.token,
+	});
 	nextTick(() => {
 		unisonReload();
 	});
-- 
cgit v1.2.3-freya

