mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 00:35:14 +00:00
feat: add the ability to make email optional (#994)
This commit is contained in:
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Nejsou k dispozici žádná náhledová data",
|
||||
"copy_all": "Kopírovat vše",
|
||||
"preview": "Náhled",
|
||||
"preview_for_user": "Náhled pro {name} ({email})",
|
||||
"preview_for_user": "Náhled pro {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Náhled OIDC dat, která by byla odeslána pro uživatele",
|
||||
"show": "Zobrazit",
|
||||
"select_an_option": "Vyberte možnost",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Ingen forhåndsvisningsdata tilgængelig",
|
||||
"copy_all": "Kopiér alt",
|
||||
"preview": "Forhåndsvisning",
|
||||
"preview_for_user": "Forhåndsvisning for {name} ({email})",
|
||||
"preview_for_user": "Forhåndsvisning for {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Forhåndsvis OIDC-data, der ville blive sendt for denne bruger",
|
||||
"show": "Vis",
|
||||
"select_an_option": "Vælg en indstilling",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Keine Vorschaudaten verfügbar",
|
||||
"copy_all": "Alles kopieren",
|
||||
"preview": "Vorschau",
|
||||
"preview_for_user": "Vorschau für {name} ({email})",
|
||||
"preview_for_user": "Vorschau für {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Vorschau der OIDC-Daten, für diesen Benutzer",
|
||||
"show": "Anzeigen",
|
||||
"select_an_option": "Wähle eine Option",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "No preview data available",
|
||||
"copy_all": "Copy All",
|
||||
"preview": "Preview",
|
||||
"preview_for_user": "Preview for {name} ({email})",
|
||||
"preview_for_user": "Preview for {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Preview the OIDC data that would be sent for this user",
|
||||
"show": "Show",
|
||||
"select_an_option": "Select an option",
|
||||
@@ -453,5 +453,7 @@
|
||||
"ui_config_disabled_info_title": "UI Configuration Disabled",
|
||||
"ui_config_disabled_info_description": "The UI configuration is disabled because the application configuration settings are managed through environment variables. Some settings may not be editable.",
|
||||
"logo_from_url_description": "Paste a direct image URL (svg, png, webp). Find icons at <link href=\"https://selfh.st/icons\">Selfh.st Icons</link> or <link href=\"https://dashboardicons.com\">Dashboard Icons</link>.",
|
||||
"invalid_url": "Invalid URL"
|
||||
"invalid_url": "Invalid URL",
|
||||
"require_user_email": "Require Email Address",
|
||||
"require_user_email_description": "Requires users to have an email address. If disabled, the users without an email address won't be able to use features that require an email address."
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "No hay datos de vista previa disponibles.",
|
||||
"copy_all": "Copiar todo",
|
||||
"preview": "Vista previa",
|
||||
"preview_for_user": "Vista previa de « {name} » ({email})",
|
||||
"preview_for_user": "Vista previa de « {name} »",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Previsualiza los datos OIDC que se enviarían para este usuario.",
|
||||
"show": "Mostrar",
|
||||
"select_an_option": "Selecciona una opción",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Aucune donnée d'aperçu disponible",
|
||||
"copy_all": "Tout copier",
|
||||
"preview": "Aperçu",
|
||||
"preview_for_user": "Aperçu pour {name} ({email})",
|
||||
"preview_for_user": "Aperçu pour {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Aperçu des données OIDC qui seraient envoyées pour cet utilisateur",
|
||||
"show": "Afficher",
|
||||
"select_an_option": "Sélectionner une option",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Dati di anteprima non disponibili",
|
||||
"copy_all": "Copia tutto",
|
||||
"preview": "Anteprima",
|
||||
"preview_for_user": "Anteprima per {name} ({email})",
|
||||
"preview_for_user": "Anteprima per {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Anteprima dei dati OIDC che saranno inviati per l'utente",
|
||||
"show": "Mostra",
|
||||
"select_an_option": "Seleziona un'opzione",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "미리보기 데이터가 없습니다",
|
||||
"copy_all": "모두 복사",
|
||||
"preview": "미리보기",
|
||||
"preview_for_user": "{name} ({email}) 미리보기",
|
||||
"preview_for_user": "{name} 미리보기",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "이 사용자를 위해 전송될 OIDC 데이터 미리보기",
|
||||
"show": "표시",
|
||||
"select_an_option": "옵션 선택",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Geen voorbeeldgegevens beschikbaar",
|
||||
"copy_all": "Alles kopiëren",
|
||||
"preview": "Voorbeeld",
|
||||
"preview_for_user": "Voorbeeld van {name} ({email})",
|
||||
"preview_for_user": "Voorbeeld van {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Bekijk een voorbeeld van de OIDC-gegevens die voor deze gebruiker zouden worden verzonden.",
|
||||
"show": "Laten zien",
|
||||
"select_an_option": "Kies een optie",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Brak dostępnych danych podglądu",
|
||||
"copy_all": "Skopiuj wszystko",
|
||||
"preview": "Podgląd",
|
||||
"preview_for_user": "Zapowiedź książki „ {name} ” ({email})",
|
||||
"preview_for_user": "Zapowiedź książki „ {name} ”",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Wyświetl podgląd danych OIDC, które zostaną wysłane dla tego użytkownika.",
|
||||
"show": "Pokaż",
|
||||
"select_an_option": "Wybierz opcję",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Não tem dados de pré-visualização disponíveis",
|
||||
"copy_all": "Copiar tudo",
|
||||
"preview": "Pré-visualização",
|
||||
"preview_for_user": "Prévia de “ {name} ” ({email})",
|
||||
"preview_for_user": "Prévia de “ {name} ”",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Dá uma olhada nos dados OIDC que seriam enviados para esse usuário.",
|
||||
"show": "Mostrar",
|
||||
"select_an_option": "Escolha uma opção",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Предварительный просмотр данных не доступен",
|
||||
"copy_all": "Копировать все",
|
||||
"preview": "Предпросмотр",
|
||||
"preview_for_user": "Предпросмотр для {name} ({email})",
|
||||
"preview_for_user": "Предпросмотр для {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Предпросмотр данных OIDC, которые будут отправлены для этого пользователя",
|
||||
"show": "Показать",
|
||||
"select_an_option": "Выберите опцию",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Inga förhandsgranskningsdata tillgängliga",
|
||||
"copy_all": "Kopiera allt",
|
||||
"preview": "Förhandsgranska",
|
||||
"preview_for_user": "Förhandsgranskning för {name} ({email})",
|
||||
"preview_for_user": "Förhandsgranskning för {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Förhandsgranska OIDC-data som skulle skickas för denna användare",
|
||||
"show": "Visa",
|
||||
"select_an_option": "Välj ett alternativ",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "Попередній перегляд даних недоступний",
|
||||
"copy_all": "Скопіювати все",
|
||||
"preview": "Попередній перегляд",
|
||||
"preview_for_user": "Попередній перегляд для {name} ({email})",
|
||||
"preview_for_user": "Попередній перегляд для {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Попередній перегляд OIDC-даних для цього користувача",
|
||||
"show": "Показати",
|
||||
"select_an_option": "Обрати варіант",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "No preview data available",
|
||||
"copy_all": "Sao chép tất cả",
|
||||
"preview": "Xem trước",
|
||||
"preview_for_user": "Xem trước cho {name} ({email})",
|
||||
"preview_for_user": "Xem trước cho {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "Xem trước dữ liệu OIDC sẽ được gửi cho người dùng này",
|
||||
"show": "Hiển thị",
|
||||
"select_an_option": "Chọn một tùy chọn",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "暂无可用的预览数据",
|
||||
"copy_all": "全部复制",
|
||||
"preview": "预览",
|
||||
"preview_for_user": "为 {name} ({email}) 预览",
|
||||
"preview_for_user": "为 {name} 预览",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "预览将为此用户发送的 OIDC 数据",
|
||||
"show": "显示",
|
||||
"select_an_option": "请选择",
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
"no_preview_data_available": "無預覽資料",
|
||||
"copy_all": "全部複製",
|
||||
"preview": "預覽",
|
||||
"preview_for_user": "預覽 {name} ({email})",
|
||||
"preview_for_user": "預覽 {name}",
|
||||
"preview_the_oidc_data_that_would_be_sent_for_this_user": "預覽將為此使用者傳送的 OIDC 資料",
|
||||
"show": "顯示",
|
||||
"select_an_option": "選擇一個選項",
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<script lang="ts">
|
||||
import FormInput from '$lib/components/form/form-input.svelte';
|
||||
import { m } from '$lib/paraglide/messages';
|
||||
import appConfigStore from '$lib/stores/application-configuration-store';
|
||||
import type { UserSignUp } from '$lib/types/user.type';
|
||||
import { preventDefault } from '$lib/utils/event-util';
|
||||
import { createForm } from '$lib/utils/form-util';
|
||||
import { tryCatch } from '$lib/utils/try-catch-util';
|
||||
import { emptyToUndefined, usernameSchema } from '$lib/utils/zod-util';
|
||||
import { get } from 'svelte/store';
|
||||
import { z } from 'zod/v4';
|
||||
|
||||
let {
|
||||
@@ -27,7 +29,7 @@
|
||||
firstName: z.string().min(1).max(50),
|
||||
lastName: emptyToUndefined(z.string().max(50).optional()),
|
||||
username: usernameSchema,
|
||||
email: z.email()
|
||||
email: get(appConfigStore).requireUserEmail ? z.email() : emptyToUndefined(z.email().optional())
|
||||
});
|
||||
type FormSchema = typeof formSchema;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ export type AppConfig = {
|
||||
disableAnimations: boolean;
|
||||
uiConfigDisabled: boolean;
|
||||
accentColor: string;
|
||||
requireUserEmail: boolean;
|
||||
};
|
||||
|
||||
export type AllAppConfig = AppConfig & {
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { UserGroup } from './user-group.type';
|
||||
export type User = {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
email: string | undefined;
|
||||
firstName: string;
|
||||
lastName?: string;
|
||||
displayName: string;
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { m } from '$lib/paraglide/messages';
|
||||
import UserService from '$lib/services/user-service';
|
||||
import appConfigStore from '$lib/stores/application-configuration-store';
|
||||
import type { UserCreate } from '$lib/types/user.type';
|
||||
import { axiosErrorToast } from '$lib/utils/error-util';
|
||||
import { preventDefault } from '$lib/utils/event-util';
|
||||
import { createForm } from '$lib/utils/form-util';
|
||||
import { emptyToUndefined, usernameSchema } from '$lib/utils/zod-util';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { get } from 'svelte/store';
|
||||
import { z } from 'zod/v4';
|
||||
|
||||
let {
|
||||
@@ -36,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()
|
||||
});
|
||||
type FormSchema = typeof formSchema;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { openConfirmDialog } from '$lib/components/confirm-dialog';
|
||||
import SwitchWithLabel from '$lib/components/form/switch-with-label.svelte';
|
||||
import FormInput from '$lib/components/form/form-input.svelte';
|
||||
import SwitchWithLabel from '$lib/components/form/switch-with-label.svelte';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import Label from '$lib/components/ui/label/label.svelte';
|
||||
import * as Select from '$lib/components/ui/select';
|
||||
@@ -32,6 +32,7 @@
|
||||
let isSendingTestEmail = $state(false);
|
||||
|
||||
const formSchema = z.object({
|
||||
requireUserEmail: z.boolean(),
|
||||
smtpHost: z.string().min(1),
|
||||
smtpPort: z.number().min(1),
|
||||
smtpUser: z.string(),
|
||||
@@ -97,7 +98,14 @@
|
||||
|
||||
<form onsubmit={preventDefault(onSubmit)}>
|
||||
<fieldset disabled={$appConfigStore.uiConfigDisabled}>
|
||||
<h4 class="text-lg font-semibold">{m.smtp_configuration()}</h4>
|
||||
<h4 class="mb-4 text-lg font-semibold">{m.general()}</h4>
|
||||
<SwitchWithLabel
|
||||
id="require-user-email"
|
||||
label={m.require_user_email()}
|
||||
description={m.require_user_email_description()}
|
||||
bind:checked={$inputs.requireUserEmail.value}
|
||||
/>
|
||||
<h4 class="mt-10 text-lg font-semibold">{m.smtp_configuration()}</h4>
|
||||
<div class="mt-4 grid grid-cols-1 items-end gap-5 md:grid-cols-2">
|
||||
<FormInput label={m.smtp_host()} bind:input={$inputs.smtpHost} />
|
||||
<FormInput label={m.smtp_port()} type="number" bind:input={$inputs.smtpPort} />
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<Dialog.Title>{m.oidc_data_preview()}</Dialog.Title>
|
||||
<Dialog.Description>
|
||||
{#if user}
|
||||
{m.preview_for_user({ name: user.displayName, email: user.email })}
|
||||
{m.preview_for_user({ name: user.displayName })}
|
||||
{:else}
|
||||
{m.preview_the_oidc_data_that_would_be_sent_for_this_user()}
|
||||
{/if}
|
||||
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user