dock: sign out in the background and return to the dock instead of landing on copyparty
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
<body>
|
||||
<main>
|
||||
<h1>Vanguard Stream <small id="who" class="who"></small>
|
||||
<a id="signout" href="/outpost.goauthentik.io/sign_out" class="who" style="float:right;text-decoration:underline" title="sign out of the Discord login (then reload the dock to log in again — needed after a group change)">sign out</a></h1>
|
||||
<a id="signout" href="#" class="who" style="float:right;text-decoration:underline" title="sign out of the Discord login and come back to the dock (log in again — needed after a group change)">sign out</a></h1>
|
||||
|
||||
<label for="title">Stream title</label>
|
||||
<input id="title" placeholder="VanguardTraining" autocomplete="off">
|
||||
@@ -207,6 +207,13 @@ $("dump").onclick = async () => {
|
||||
} catch (e) { status("dump failed: " + e.message, "bad"); }
|
||||
};
|
||||
|
||||
$("signout").onclick = async e => {
|
||||
e.preventDefault(); status("signing out…");
|
||||
// Authentik's sign-out redirects to the site root (copyparty); do it in the background, then reload the dock,
|
||||
// which sends us through the Discord login and back here.
|
||||
try { await fetch("/outpost.goauthentik.io/sign_out", {credentials:"same-origin", mode:"no-cors", redirect:"follow"}); } catch(e){}
|
||||
setTimeout(() => location.replace("/dock/"), 500);
|
||||
};
|
||||
whoami(); renderPreview();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user