feat:move auth demo to main

This commit is contained in:
2025-09-27 13:59:37 +02:00
parent d8e2569210
commit 806fb925f0
8 changed files with 44 additions and 49 deletions

View File

@@ -0,0 +1,21 @@
<script lang="ts">
import { enhance } from '$app/forms';
import type { ActionData } from './$types';
let { form }: { form: ActionData } = $props();
</script>
<h1>Login/Register</h1>
<form method="post" action="?/login" use:enhance>
<label>
Username
<input name="username" />
</label>
<label>
Password
<input type="password" name="password" />
</label>
<button>Login</button>
<button formaction="?/register">Register</button>
</form>
<p style="color: red">{form?.message ?? ''}</p>