fix(app): require a username on username-only instances (#3430)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-12 20:10:05 +02:00
1 parent 9bc43c0c08
commit d1b4b82895
1 file changed
+4 -1
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
import type {RuntimeConfigSnapshot} from '@app/features/app/state/InstanceSnapshotStore'; import type {RuntimeConfigSnapshot} from '@app/features/app/state/InstanceSnapshotStore';
import {usesUsernameSignIn} from '@app/features/app/utils/AccountIdentityFeatures';
import type * as AuthenticationCommands from '@app/features/auth/commands/AuthenticationCommands'; import type * as AuthenticationCommands from '@app/features/auth/commands/AuthenticationCommands';
import authStyles from '@app/features/auth/components/accounts/account_switcher_modal/AccountSwitcherAuthFlow.module.css'; import authStyles from '@app/features/auth/components/accounts/account_switcher_modal/AccountSwitcherAuthFlow.module.css';
import pageStyles from '@app/features/auth/flow/AuthPageStyles.module.css'; import pageStyles from '@app/features/auth/flow/AuthPageStyles.module.css';
@@ -35,6 +36,7 @@ export const AccountSwitcherRegisterStep = observer(function AccountSwitcherRegi
/> />
); );
} }
const usernameSignIn = usesUsernameSignIn(runtimeSnapshot.features);
return ( return (
<> <>
<h1 <h1
@@ -49,10 +51,11 @@ export const AccountSwitcherRegisterStep = observer(function AccountSwitcherRegi
> >
<AuthRegisterFormCore <AuthRegisterFormCore
fields={{ fields={{
showEmail: true, showEmail: !usernameSignIn,
showPassword: true, showPassword: true,
showPasswordConfirmation: true, showPasswordConfirmation: true,
showUsernameValidation: true, showUsernameValidation: true,
requireUsername: usernameSignIn,
}} }}
submitLabel={<Trans>Create account</Trans>} submitLabel={<Trans>Create account</Trans>}
redirectPath="" redirectPath=""