<script lang="ts">
  import type { PageProps } from './$types';

  let { data, form }: PageProps = $props();
</script>

{#if form?.error}
  <p>Unknown username or password</p>
{/if}

<form method="POST">
  <label>
    Username
    <input name="username" type="text" value={form?.username} />
  </label>
  <label>
    Password
    <input name="password" type="password" />
  </label>
  <button>Log in</button>
  <input type="hidden" name="return" value={data.return} />
</form>
