mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-13 20:46:13 -04:00
Compare commits
3 Commits
v5-develop
...
small-fixe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e08b0cc3d | ||
|
|
8f3e4ccbf6 | ||
|
|
eeb81ba80e |
@@ -83,7 +83,7 @@ function RootFolderRow(props: RootFolderRowProps) {
|
|||||||
isOpen={isDeleteModalOpen}
|
isOpen={isDeleteModalOpen}
|
||||||
kind={kinds.DANGER}
|
kind={kinds.DANGER}
|
||||||
title={translate('RemoveRootFolder')}
|
title={translate('RemoveRootFolder')}
|
||||||
message={translate('RemoveRootFolderMessageText', { path })}
|
message={translate('RemoveRootFolderWithSeriesMessageText', { path })}
|
||||||
confirmLabel={translate('Remove')}
|
confirmLabel={translate('Remove')}
|
||||||
onConfirm={onConfirmDelete}
|
onConfirm={onConfirmDelete}
|
||||||
onCancel={onDeleteModalClose}
|
onCancel={onDeleteModalClose}
|
||||||
|
|||||||
@@ -55,13 +55,13 @@ function Tag({ id, label }: TagProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleConfirmDeleteTag = useCallback(() => {
|
const handleConfirmDeleteTag = useCallback(() => {
|
||||||
setIsDeleteTagModalOpen(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleDeleteTagModalClose = useCallback(() => {
|
|
||||||
dispatch(deleteTag({ id }));
|
dispatch(deleteTag({ id }));
|
||||||
}, [id, dispatch]);
|
}, [id, dispatch]);
|
||||||
|
|
||||||
|
const handleDeleteTagModalClose = useCallback(() => {
|
||||||
|
setIsDeleteTagModalOpen(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={styles.tag}
|
className={styles.tag}
|
||||||
|
|||||||
@@ -209,9 +209,20 @@ namespace NzbDrone.Core.Configuration
|
|||||||
return AuthenticationType.Forms;
|
return AuthenticationType.Forms;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Enum.TryParse<AuthenticationType>(_authOptions.Method, out var enumValue)
|
var value = Enum.TryParse<AuthenticationType>(_authOptions.Method, out var enumValue)
|
||||||
? enumValue
|
? enumValue
|
||||||
: GetValueEnum("AuthenticationMethod", AuthenticationType.None);
|
: GetValueEnum("AuthenticationMethod", AuthenticationType.None);
|
||||||
|
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
|
if (value == AuthenticationType.Basic)
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
{
|
||||||
|
SetValue("AuthenticationMethod", AuthenticationType.Forms);
|
||||||
|
|
||||||
|
return AuthenticationType.Forms;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,6 +397,12 @@ namespace NzbDrone.Core.Configuration
|
|||||||
{
|
{
|
||||||
SetValue("EnableSsl", false);
|
SetValue("EnableSsl", false);
|
||||||
}
|
}
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
|
if (AuthenticationMethod == AuthenticationType.Basic)
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
{
|
||||||
|
SetValue("AuthenticationMethod", AuthenticationType.Forms);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteOldValues()
|
private void DeleteOldValues()
|
||||||
|
|||||||
@@ -1739,7 +1739,7 @@
|
|||||||
"RemoveQueueItemRemovalMethodHelpTextWarning": "'Remove from Download Client' will remove the download and the file(s) from the download client.",
|
"RemoveQueueItemRemovalMethodHelpTextWarning": "'Remove from Download Client' will remove the download and the file(s) from the download client.",
|
||||||
"RemoveQueueItemsRemovalMethodHelpTextWarning": "'Remove from Download Client' will remove the downloads and the files from the download client.",
|
"RemoveQueueItemsRemovalMethodHelpTextWarning": "'Remove from Download Client' will remove the downloads and the files from the download client.",
|
||||||
"RemoveRootFolder": "Remove Root Folder",
|
"RemoveRootFolder": "Remove Root Folder",
|
||||||
"RemoveRootFolderMessageText": "Are you sure you want to remove the root folder '{path}'? Files and folders will not be deleted from disk, and series in this root folder will not be removed from {appName}.",
|
"RemoveRootFolderWithSeriesMessageText": "Are you sure you want to remove the root folder '{path}'? Files and folders will not be deleted from disk, and series in this root folder will not be removed from {appName}.",
|
||||||
"RemoveSelected": "Remove Selected",
|
"RemoveSelected": "Remove Selected",
|
||||||
"RemoveSelectedBlocklistMessageText": "Are you sure you want to remove the selected items from the blocklist?",
|
"RemoveSelectedBlocklistMessageText": "Are you sure you want to remove the selected items from the blocklist?",
|
||||||
"RemoveSelectedItem": "Remove Selected Item",
|
"RemoveSelectedItem": "Remove Selected Item",
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Sonarr.Http.Authentication
|
|||||||
|
|
||||||
public static AuthenticationBuilder AddAppAuthentication(this IServiceCollection services)
|
public static AuthenticationBuilder AddAppAuthentication(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddOptions<CookieAuthenticationOptions>(AuthenticationType.Forms.ToString())
|
services.AddOptions<CookieAuthenticationOptions>(nameof(AuthenticationType.Forms))
|
||||||
.Configure<IConfigFileProvider>((options, configFileProvider) =>
|
.Configure<IConfigFileProvider>((options, configFileProvider) =>
|
||||||
{
|
{
|
||||||
// Replace diacritics and replace non-word characters to ensure cookie name doesn't contain any valid URL characters not allowed in cookie names
|
// Replace diacritics and replace non-word characters to ensure cookie name doesn't contain any valid URL characters not allowed in cookie names
|
||||||
@@ -47,12 +47,9 @@ namespace Sonarr.Http.Authentication
|
|||||||
});
|
});
|
||||||
|
|
||||||
return services.AddAuthentication()
|
return services.AddAuthentication()
|
||||||
.AddNone(AuthenticationType.None.ToString())
|
.AddNone(nameof(AuthenticationType.None))
|
||||||
.AddExternal(AuthenticationType.External.ToString())
|
.AddExternal(nameof(AuthenticationType.External))
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
.AddCookie(nameof(AuthenticationType.Forms))
|
||||||
.AddCookie(AuthenticationType.Basic.ToString())
|
|
||||||
#pragma warning restore CS0618 // Type or member is obsolete
|
|
||||||
.AddCookie(AuthenticationType.Forms.ToString())
|
|
||||||
.AddApiKey("API", options =>
|
.AddApiKey("API", options =>
|
||||||
{
|
{
|
||||||
options.HeaderName = "X-Api-Key";
|
options.HeaderName = "X-Api-Key";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace NzbDrone.Http.Authentication
|
|||||||
{
|
{
|
||||||
public class UiAuthorizationPolicyProvider : IAuthorizationPolicyProvider
|
public class UiAuthorizationPolicyProvider : IAuthorizationPolicyProvider
|
||||||
{
|
{
|
||||||
private const string POLICY_NAME = "UI";
|
private const string PolicyName = "UI";
|
||||||
private readonly IConfigFileProvider _config;
|
private readonly IConfigFileProvider _config;
|
||||||
|
|
||||||
public DefaultAuthorizationPolicyProvider FallbackPolicyProvider { get; }
|
public DefaultAuthorizationPolicyProvider FallbackPolicyProvider { get; }
|
||||||
@@ -26,7 +26,7 @@ namespace NzbDrone.Http.Authentication
|
|||||||
|
|
||||||
public Task<AuthorizationPolicy> GetPolicyAsync(string policyName)
|
public Task<AuthorizationPolicy> GetPolicyAsync(string policyName)
|
||||||
{
|
{
|
||||||
if (policyName.Equals(POLICY_NAME, StringComparison.OrdinalIgnoreCase))
|
if (policyName.Equals(PolicyName, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var policy = new AuthorizationPolicyBuilder(_config.AuthenticationMethod.ToString())
|
var policy = new AuthorizationPolicyBuilder(_config.AuthenticationMethod.ToString())
|
||||||
.AddRequirements(new BypassableDenyAnonymousAuthorizationRequirement());
|
.AddRequirements(new BypassableDenyAnonymousAuthorizationRequirement());
|
||||||
|
|||||||
Reference in New Issue
Block a user