Handle auth options correctly in Security Settings

(cherry picked from commit 0fad20e327503bac767c4df4c893f5e418866831)
(cherry picked from commit 180dafe696be25a9903b6770997005577504a914)
pull/4220/head
Qstick 1 year ago
parent c4a339f0af
commit f040835321

@ -11,9 +11,7 @@ import ConfirmModal from 'Components/Modal/ConfirmModal';
import { icons, inputTypes, kinds } from 'Helpers/Props'; import { icons, inputTypes, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
export const authenticationRequiredWarning = 'To prevent remote access without authentication, Radarr now requires authentication to be enabled. You can optionally disable authentication from local addresses.'; export const authenticationMethodOptions = [
const authenticationMethodOptions = [
{ {
key: 'none', key: 'none',
get value() { get value() {
@ -21,6 +19,13 @@ const authenticationMethodOptions = [
}, },
isDisabled: true isDisabled: true
}, },
{
key: 'external',
get value() {
return translate('External');
},
isHidden: true
},
{ {
key: 'basic', key: 'basic',
get value() { get value() {
@ -36,14 +41,39 @@ const authenticationMethodOptions = [
]; ];
export const authenticationRequiredOptions = [ export const authenticationRequiredOptions = [
{ key: 'enabled', value: 'Enabled' }, {
{ key: 'disabledForLocalAddresses', value: 'Disabled for Local Addresses' } key: 'enabled',
get value() {
return translate('Enabled');
}
},
{
key: 'disabledForLocalAddresses',
get value() {
return translate('DisabledForLocalAddresses');
}
}
]; ];
const certificateValidationOptions = [ const certificateValidationOptions = [
{ key: 'enabled', value: 'Enabled' }, {
{ key: 'disabledForLocalAddresses', value: 'Disabled for Local Addresses' }, key: 'enabled',
{ key: 'disabled', value: 'Disabled' } get value() {
return translate('Enabled');
}
},
{
key: 'disabledForLocalAddresses',
get value() {
return translate('DisabledForLocalAddresses');
}
},
{
key: 'disabled',
get value() {
return translate('Disabled');
}
}
]; ];
class SecuritySettings extends Component { class SecuritySettings extends Component {
@ -112,7 +142,7 @@ class SecuritySettings extends Component {
name="authenticationMethod" name="authenticationMethod"
values={authenticationMethodOptions} values={authenticationMethodOptions}
helpText={translate('AuthenticationMethodHelpText')} helpText={translate('AuthenticationMethodHelpText')}
helpTextWarning={authenticationRequiredWarning} helpTextWarning={translate('AuthenticationRequiredWarning')}
onChange={onInputChange} onChange={onInputChange}
{...authenticationMethod} {...authenticationMethod}
/> />
@ -121,13 +151,13 @@ class SecuritySettings extends Component {
{ {
authenticationEnabled ? authenticationEnabled ?
<FormGroup> <FormGroup>
<FormLabel>Authentication Required</FormLabel> <FormLabel>{translate('AuthenticationRequired')}</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.SELECT} type={inputTypes.SELECT}
name="authenticationRequired" name="authenticationRequired"
values={authenticationRequiredOptions} values={authenticationRequiredOptions}
helpText="Change which requests authentication is required for. Do not change unless you understand the risks." helpText={translate('AuthenticationRequiredHelpText')}
onChange={onInputChange} onChange={onInputChange}
{...authenticationRequired} {...authenticationRequired}
/> />

@ -103,6 +103,8 @@
"ArtistType": "Artist Type", "ArtistType": "Artist Type",
"Artists": "Artists", "Artists": "Artists",
"AudioInfo": "Audio Info", "AudioInfo": "Audio Info",
"AuthBasic": "Basic (Browser Popup)",
"AuthForm": "Forms (Login Page)",
"Authentication": "Authentication", "Authentication": "Authentication",
"AuthenticationMethodHelpText": "Require Username and Password to access Lidarr", "AuthenticationMethodHelpText": "Require Username and Password to access Lidarr",
"AutoAdd": "Auto Add", "AutoAdd": "Auto Add",
@ -269,6 +271,7 @@
"DetailedProgressBarHelpText": "Show text on progess bar", "DetailedProgressBarHelpText": "Show text on progess bar",
"Details": "Details", "Details": "Details",
"Disabled": "Disabled", "Disabled": "Disabled",
"DisabledForLocalAddresses": "Disabled for Local Addresses",
"Disambiguation": "Disambiguation", "Disambiguation": "Disambiguation",
"DiscCount": "Disc Count", "DiscCount": "Disc Count",
"DiscNumber": "Disc Number", "DiscNumber": "Disc Number",
@ -363,6 +366,7 @@
"ExpandOtherByDefaultHelpText": "Other", "ExpandOtherByDefaultHelpText": "Other",
"ExpandSingleByDefaultHelpText": "Singles", "ExpandSingleByDefaultHelpText": "Singles",
"ExportCustomFormat": "Export Custom Format", "ExportCustomFormat": "Export Custom Format",
"External": "External",
"ExtraFileExtensionsHelpTexts1": "Comma separated list of extra files to import (.nfo will be imported as .nfo-orig)", "ExtraFileExtensionsHelpTexts1": "Comma separated list of extra files to import (.nfo will be imported as .nfo-orig)",
"ExtraFileExtensionsHelpTexts2": "\"Examples: \".sub", "ExtraFileExtensionsHelpTexts2": "\"Examples: \".sub",
"FailedDownloadHandling": "Failed Download Handling", "FailedDownloadHandling": "Failed Download Handling",

Loading…
Cancel
Save