requiring an email address for users is now configurable (#1914)

This commit is contained in:
Athou
2026-01-10 18:11:35 +01:00
parent 2e8fd737af
commit d711cbab49
6 changed files with 19 additions and 2 deletions

View File

@@ -220,6 +220,7 @@ export interface ServerInfo {
version: string
gitCommit: string
allowRegistrations: boolean
emailAddressRequired: boolean
smtpEnabled: boolean
demoAccountEnabled: boolean
websocketEnabled: boolean

View File

@@ -20,6 +20,7 @@ interface FormData extends ProfileModificationRequest {
export function ProfileSettings() {
const profile = useAppSelector(state => state.user.profile)
const serverInfos = useAppSelector(state => state.server.serverInfos)
const dispatch = useAppDispatch()
const { _ } = useLingui()
@@ -134,7 +135,12 @@ export function ProfileSettings() {
required
{...form.getInputProps("currentPassword")}
/>
<TextInput type="email" label={<Trans>E-mail</Trans>} {...form.getInputProps("email")} required />
<TextInput
type="email"
label={<Trans>E-mail</Trans>}
{...form.getInputProps("email")}
required={serverInfos?.emailAddressRequired}
/>
<PasswordInput
label={<Trans>New password</Trans>}
description={<Trans>Changing password will generate a new API key</Trans>}

View File

@@ -72,7 +72,7 @@ export function RegistrationPage() {
placeholder={_(msg`E-mail address`)}
{...form.getInputProps("email")}
size="md"
required
required={serverInfos.emailAddressRequired}
/>
<PasswordInput
label={<Trans>Password</Trans>}