1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-24 05:30:07 +00:00

feat: add the ability to make email optional (#994)

This commit is contained in:
Elias Schneider
2025-10-03 11:24:53 +02:00
committed by GitHub
parent 043cce615d
commit 507f9490fa
44 changed files with 175 additions and 69 deletions

View File

@@ -8,6 +8,7 @@
import { preventDefault } from '$lib/utils/event-util';
import { createForm } from '$lib/utils/form-util';
import { emptyToUndefined, usernameSchema } from '$lib/utils/zod-util';
import { get } from 'svelte/store';
import { z } from 'zod/v4';
let {
@@ -37,7 +38,9 @@
lastName: emptyToUndefined(z.string().max(50).optional()),
displayName: z.string().min(1).max(100),
username: usernameSchema,
email: z.email(),
email: get(appConfigStore).requireUserEmail
? z.email()
: emptyToUndefined(z.email().optional()),
isAdmin: z.boolean(),
disabled: z.boolean()
});