From 36b99968b66e3cc57781e0144a73fa6f0a645b87 Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 04:54:15 +0100 Subject: [PATCH] add Twitch identity disconnect controls --- src/App.svelte | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/App.svelte b/src/App.svelte index c2c7d54..3327f19 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -328,6 +328,23 @@ } } + async function revokeOAuth(identity: 'streamer' | 'bot') { + oauthBusy = true; + oauthError = ''; + try { + const response = await fetch(`${serverAddress}/api/v1/twitch/oauth/revoke?identity=${identity}`, { + method: 'POST', + headers: { authorization: `Bearer ${sessionToken}` }, + }); + if (!response.ok) throw new Error('The server could not revoke this Twitch authorization.'); + await loadStreamInfo(); + } catch (error) { + oauthError = error instanceof Error ? error.message : 'The Twitch authorization could not be revoked.'; + } finally { + oauthBusy = false; + } + } + async function copyOAuthLink() { if (!oauthLink) return; await navigator.clipboard.writeText(oauthLink).catch(() => { @@ -378,7 +395,9 @@ {#if authenticated}
+ +
{#if oauthLink}