From dddef149aea597a145e3717b2c461b251e0f6a8d Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 20 Aug 2025 13:39:01 +0200
Subject: feat: oidc attempt 82845345

---
 src/routes/home/+page.svelte | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 src/routes/home/+page.svelte

(limited to 'src/routes/home/+page.svelte')

diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte
new file mode 100644
index 0000000..8fa9ddd
--- /dev/null
+++ b/src/routes/home/+page.svelte
@@ -0,0 +1,34 @@
+<script lang="ts">
+  import { page } from '$app/state';
+  import { checkScope } from '$lib/auth';
+  import type { Session } from '../../hooks.server';
+  let session = $derived(page.data.session as Session);
+</script>
+
+<svelte:head>
+  <title>Crunched - Home</title>
+</svelte:head>
+
+<article>
+  <h2 class="text-2xl">Home</h2>
+  <div>
+    {#if session}
+      <div>
+        <small>Signed in as</small><br />
+        <strong>{session.userInfo.preferred_username ?? 'User'}</strong>
+      </div>
+      <div>
+        <small>Scope</small><br />
+        <strong>{session.tokens.scope}</strong>
+      </div>
+      <button
+        onclick={() => {
+          alert(checkScope(session, ['vm-own-write'], true));
+        }}>need scope</button
+      >
+      <!-- <div slot="submitButton" class="buttonPrimary">Sign out</div> -->
+    {:else}
+      <span class="notSignedInText">You are not signed in</span>
+    {/if}
+  </div>
+</article>
-- 
cgit v1.2.3

