From 60cc3e958cee1ecb12ea93135c66f0c66cb07c43 Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Thu, 31 Jul 2025 10:57:45 +0100 Subject: [PATCH] logging out --- src/components/dashboard/Settings.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/dashboard/Settings.tsx b/src/components/dashboard/Settings.tsx index 104d316..818322a 100644 --- a/src/components/dashboard/Settings.tsx +++ b/src/components/dashboard/Settings.tsx @@ -3,7 +3,8 @@ // import { isSettingsOpen, userInfo } from "~/lib/stores"; // import { StereoUser } from "~/lib/types"; -import { component$, useComputed$, useSignal, useTask$ } from "@builder.io/qwik"; +import { $, component$, useComputed$, useSignal, useTask$ } from "@builder.io/qwik"; +import ky from "ky"; import { useNanostore$ } from "~/hooks/nanostores"; import { isSettingsOpen } from "~/lib/stores"; @@ -34,9 +35,22 @@ const PrivacyAndSecurity = component$(() => { }); const DangerZone = component$(() => { + const handleLogout = $(() => { + ky.get("/api/auth/logout", { credentials: "include" }) + .then(() => { + window.location.href = "/"; + }); + }); + return (

delete your account and data here

+
); });