2024-07-31 10:29:46 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { enhance } from "$app/forms";
|
2024-08-02 15:33:18 +02:00
|
|
|
import Modal from "$lib/components/Modal.svelte";
|
2024-07-31 10:29:46 +02:00
|
|
|
|
|
|
|
|
const { data, form } = $props();
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-08-01 18:09:35 +02:00
|
|
|
{#if form?.success}
|
|
|
|
|
<p>{form.message}</p>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{#if form?.success === false}
|
|
|
|
|
<p>{form.message}</p>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2024-07-31 10:29:46 +02:00
|
|
|
<section>
|
|
|
|
|
<h2>Overview</h2>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
<strong>Username:</strong>
|
|
|
|
|
{data.user.username}
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<strong>ID:</strong>
|
|
|
|
|
{data.user.id}
|
|
|
|
|
</p>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section>
|
|
|
|
|
<h2>Logout</h2>
|
|
|
|
|
|
|
|
|
|
<form method="POST" action="?/logout" use:enhance>
|
|
|
|
|
<button type="submit">Logout</button>
|
|
|
|
|
</form>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section>
|
|
|
|
|
<h2>Delete account</h2>
|
|
|
|
|
|
2024-08-02 15:33:18 +02:00
|
|
|
<Modal id="delete-account" text="Delete account">
|
|
|
|
|
<h3>Delete account</h3>
|
2024-07-31 10:29:46 +02:00
|
|
|
|
2024-08-02 15:33:18 +02:00
|
|
|
<p>
|
|
|
|
|
<strong>Caution!</strong>
|
|
|
|
|
Deleting your account will irretrievably erase all data.
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<form method="POST" action="?/deleteAccount" use:enhance>
|
|
|
|
|
<label>
|
|
|
|
|
Password:
|
|
|
|
|
<input type="password" name="password" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<button type="submit">Permanently delete account</button>
|
|
|
|
|
</form>
|
|
|
|
|
</Modal>
|
2024-07-31 10:29:46 +02:00
|
|
|
</section>
|