Added salutation field (#183)

* Added salutation field

* Handle honeypot in backend

---------

Co-authored-by: Karl Ludwig Weise <ludwig@ludwigweise.de>
Co-authored-by: Hendrik Belitz <hendrik@innovation-through-understanding.de>
This commit is contained in:
Karl Ludwig Weise
2026-01-22 11:28:17 +01:00
committed by GitHub
co-authored by Karl Ludwig Weise Hendrik Belitz
parent 1fa1a07055
commit 25f10462da
7 changed files with 27 additions and 0 deletions
+1
View File
@@ -70,6 +70,7 @@
"pinInsecure": "Diese PIN ist zu unsicher"
},
"passkey": "Passkey",
"salutation": "Anrede",
"name": "Name",
"phone": "Telefonnummer",
"pin": "PIN",
+1
View File
@@ -86,6 +86,7 @@
},
"noPassAtAll": "Either passphrase or passkey is required",
"passkey": "Passkey",
"salutation": "Salutation",
"name": "Name",
"phone": "Phone Number",
"pin": "PIN",
+3
View File
@@ -69,6 +69,7 @@ interface EncryptedData {
}
export interface AppointmentData {
salutation?: string;
name: string;
email: string;
shareEmail: boolean;
@@ -328,6 +329,7 @@ export class UnifiedAppointmentCrypto {
staffKeyShares: await this.getStaffKeyShares(tenantId),
clientKeyShare: await this.getClientKeyShare(),
clientEncryptedTunnelKey: await this.encryptTunnelKeyForClient(),
salutation: appointmentData.salutation,
}
: {
// Existing client
@@ -340,6 +342,7 @@ export class UnifiedAppointmentCrypto {
clientEmail: appointmentData.shareEmail ? appointmentData.email : undefined,
clientLanguage,
encryptedAppointment,
salutation: appointmentData.salutation,
};
const response = await fetch(endpoint, {
+1
View File
@@ -39,6 +39,7 @@ export type TPublicAppointment = {
duration: number;
};
data?: {
salutation: string;
name: string;
shareEmail: boolean;
email: string;
@@ -19,6 +19,7 @@
const form = superForm(
{
salutation: "",
name: "",
shareEmail: false,
email: "",
@@ -37,6 +38,7 @@
proceed({
...appointment,
data: {
salutation: validation.data.salutation,
name: validation.data.name,
shareEmail: validation.data.shareEmail,
email: validation.data.email,
@@ -68,6 +70,15 @@
>
</Alert.Root>
<Form.Root {enhance} class="flex flex-col gap-4">
<Form.Field {form} name="salutation" class="hidden">
<Form.Control>
{#snippet children({ props })}
<Form.Label>{m["form.salutation"]()}</Form.Label>
<Input {...props} bind:value={$formData.salutation} type="text" />
{/snippet}
</Form.Control>
<Form.FieldErrors />
</Form.Field>
<Form.Field {form} name="name">
<Form.Control>
{#snippet children({ props })}
@@ -29,6 +29,7 @@ const requestSchema = z.object({
duration: z.number().int().positive(),
clientEmail: z.email().optional(),
clientLanguage: z.string().optional().default("en"),
salutation: z.string().optional(),
encryptedAppointment: z.object({
encryptedPayload: z.string(),
iv: z.string(),
@@ -202,6 +203,10 @@ export const POST: RequestHandler = async ({ request, params }) => {
const body = await request.json();
const validatedData = requestSchema.parse(body);
if (validatedData.salutation) {
throw new ValidationError("Bees incoming");
}
logger.info("Adding appointment to existing tunnel", {
tenantId,
tunnelId: validatedData.tunnelId,
@@ -16,6 +16,7 @@ const requestSchema = z.object({
clientLanguage: z.string().optional().default("en"),
clientPublicKey: z.string(),
privateKeyShare: z.string(),
salutation: z.string().optional(),
encryptedAppointment: z.object({
encryptedPayload: z.string(),
iv: z.string(),
@@ -228,6 +229,10 @@ export const POST: RequestHandler = async ({ request, params }) => {
const body = await request.json();
const validatedData = requestSchema.parse(body);
if (validatedData.salutation) {
throw new ValidationError("Bees incoming");
}
logger.info("Creating new client appointment tunnel", {
tenantId,
tunnelId: validatedData.tunnelId,