Files
ianitor/apps/web/src/views/SignedIn.svelte
T

34 lines
1.1 KiB
Svelte

<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §10.2: Authelia sends the sign-in tab back here; it tells the first tab and closes.
import { onMount } from "svelte";
onMount(() => {
const back = new URL(location.href).searchParams.get("back");
try {
const ch = new BroadcastChannel("ianitor-auth");
ch.postMessage("signed-in");
ch.close();
} catch {
/* the first tab rechecks with "I have signed in" */
}
if (back && back.startsWith("/") && !back.startsWith("//")) {
location.replace(back);
return;
}
setTimeout(() => window.close(), 300);
});
</script>
<main class="signed-in">
<p class="ia-wordmark">IANITOR DOMI</p>
<h1 class="ia-h3">You are signed in again.</h1>
<p class="ia-text2">You can close this tab and go back to Ianitor.</p>
</main>
<style>
.signed-in { max-width: 420px; margin: 20vh auto; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
</style>