mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Add basic forms and routes
This commit is contained in:
@@ -18,6 +18,6 @@ export const actions = {
|
||||
}
|
||||
|
||||
cookies.set("session_token", response.token, { path: "/" });
|
||||
return { success: true };
|
||||
return { success: true, message: "Successfully logged in" };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
const { form } = $props();
|
||||
</script>
|
||||
|
||||
{#if form?.success}
|
||||
<p>{form.message}</p>
|
||||
{/if}
|
||||
|
||||
{#if form?.success === false}
|
||||
<p>{form.message}</p>
|
||||
{/if}
|
||||
|
||||
<form method="POST" use:enhance>
|
||||
{#if form?.success}
|
||||
<p>Successfully logged in</p>
|
||||
{/if}
|
||||
|
||||
{#if form?.success === false}
|
||||
<p>{form.message}</p>
|
||||
{/if}
|
||||
|
||||
<label>
|
||||
Username
|
||||
Username:
|
||||
<input type="text" name="username" required />
|
||||
</label>
|
||||
<label>
|
||||
Password
|
||||
Password:
|
||||
<input type="password" name="password" required />
|
||||
</label>
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@ export const actions = {
|
||||
return { success: false, message: response.message };
|
||||
}
|
||||
|
||||
return { success: true };
|
||||
return { success: true, message: "Successfully registered, you can now login" };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
const { form } = $props();
|
||||
</script>
|
||||
|
||||
{#if form?.success}
|
||||
<p>{form.message}</p>
|
||||
{/if}
|
||||
|
||||
{#if form?.success === false}
|
||||
<p>{form.message}</p>
|
||||
{/if}
|
||||
|
||||
<form method="POST" use:enhance>
|
||||
{#if form?.success}
|
||||
<p>Successfully registered</p>
|
||||
{/if}
|
||||
|
||||
{#if form?.success === false}
|
||||
<p>{form.message}</p>
|
||||
{/if}
|
||||
|
||||
<label>
|
||||
Username
|
||||
Username:
|
||||
<input type="text" name="username" minlength="3" maxlength="16" required />
|
||||
</label>
|
||||
<label>
|
||||
Password
|
||||
Password:
|
||||
<input type="password" name="password" minlength="12" maxlength="128" required />
|
||||
</label>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user