logging out
This commit is contained in:
parent
dcfd3df713
commit
60cc3e958c
1 changed files with 15 additions and 1 deletions
|
@ -3,7 +3,8 @@
|
||||||
// import { isSettingsOpen, userInfo } from "~/lib/stores";
|
// import { isSettingsOpen, userInfo } from "~/lib/stores";
|
||||||
// import { StereoUser } from "~/lib/types";
|
// 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 { useNanostore$ } from "~/hooks/nanostores";
|
||||||
import { isSettingsOpen } from "~/lib/stores";
|
import { isSettingsOpen } from "~/lib/stores";
|
||||||
|
|
||||||
|
@ -34,9 +35,22 @@ const PrivacyAndSecurity = component$(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const DangerZone = component$(() => {
|
const DangerZone = component$(() => {
|
||||||
|
const handleLogout = $(() => {
|
||||||
|
ky.get("/api/auth/logout", { credentials: "include" })
|
||||||
|
.then(() => {
|
||||||
|
window.location.href = "/";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p>delete your account and data here</p>
|
<p>delete your account and data here</p>
|
||||||
|
<button
|
||||||
|
onClick$={handleLogout}
|
||||||
|
class="text-white bg-stereo hover:bg-stereo/80 transition-colors rounded-lg px-4 py-2"
|
||||||
|
>
|
||||||
|
log out
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue