diff options
Diffstat (limited to 'apps/browser-extension/src/OptionsPage.tsx')
| -rw-r--r-- | apps/browser-extension/src/OptionsPage.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/browser-extension/src/OptionsPage.tsx b/apps/browser-extension/src/OptionsPage.tsx index 9670558e..24785857 100644 --- a/apps/browser-extension/src/OptionsPage.tsx +++ b/apps/browser-extension/src/OptionsPage.tsx @@ -17,6 +17,8 @@ export default function OptionsPage() { }, ); + const { mutate: deleteKey } = api.apiKeys.revoke.useMutation(); + const invalidateWhoami = api.useUtils().users.whoami.refetch; useEffect(() => { @@ -39,7 +41,10 @@ export default function OptionsPage() { } const onLogout = () => { - setSettings((s) => ({ ...s, apiKey: "" })); + if (settings.apiKeyId) { + deleteKey({ id: settings.apiKeyId }); + } + setSettings((s) => ({ ...s, apiKey: "", apiKeyId: undefined })); invalidateWhoami(); navigate("/notconfigured"); }; |
