add LEGACY_AUTH env variable (#1473)

This commit is contained in:
jeffvli
2026-01-01 20:33:27 -08:00
parent aaf840d358
commit 55cead87c8
8 changed files with 20 additions and 7 deletions
@@ -94,9 +94,12 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
const { addServer, setCurrentServer } = useAuthStoreActions();
const { servers: discovered } = useAutodiscovery();
const isServerLock = Boolean(window.SERVER_LOCK) || false;
const legacyAuthDefault = isServerLock ? Boolean(window.LEGACY_AUTHENTICATION) || false : false;
const form = useForm({
initialValues: {
legacyAuth: false,
legacyAuth: legacyAuthDefault,
name:
(localSettings ? localSettings.env.SERVER_NAME : window.SERVER_NAME) || 'My Server',
password: '',
@@ -113,9 +116,6 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
},
});
// server lock for web is only true if lock is true *and* all other properties are set
const isServerLock = Boolean(window.SERVER_LOCK) || false;
const isSubmitDisabled = !form.values.name || !form.values.url || !form.values.username;
const fillServerDetails = (server: DiscoveredServerItem) => {
@@ -308,6 +308,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
)}
{form.values.type === ServerType.SUBSONIC && (
<Checkbox
disabled={isServerLock}
label={t('form.addServer.input', {
context: 'legacyAuthentication',
postProcess: 'titleCase',