feat(frontend): register/log in with email

This commit is contained in:
sam 2024-12-04 17:43:02 +01:00
parent 57e1ec09c0
commit bc7fd6d804
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
19 changed files with 598 additions and 380 deletions

View file

@ -4,8 +4,8 @@
import type { RawApiError } from "$api/error";
import ErrorAlert from "$components/ErrorAlert.svelte";
type Props = { form: { error: RawApiError | null; ok: boolean } | null };
let { form }: Props = $props();
type Props = { form: { error: RawApiError | null; ok: boolean } | null; successMessage?: string };
let { form, successMessage }: Props = $props();
</script>
{#if form?.error}
@ -13,6 +13,6 @@
{:else if form?.ok}
<p class="text-success-emphasis">
<Icon name="check-circle-fill" />
{$t("edit-profile.saved-changes")}
{successMessage ?? $t("edit-profile.saved-changes")}
</p>
{/if}

View file

@ -1,6 +1,5 @@
<script lang="ts">
import type { RawApiError } from "$api/error";
import { enhance } from "$app/forms";
import ErrorAlert from "$components/ErrorAlert.svelte";
import { t } from "$lib/i18n";
import { Button, Input, Label } from "@sveltestrap/sveltestrap";
@ -21,7 +20,7 @@
<ErrorAlert {error} />
{/if}
<form method="POST" use:enhance>
<form method="POST">
<div class="mb-3">
<Label>{remoteLabel}</Label>
<Input type="text" readonly value={remoteUser} />