From 83754ff34924cc5b7ffcd559a72fa2020d14d9a1 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 19 Jun 2025 16:47:34 -0700 Subject: [PATCH] Change authentication to Forms if set to Basic (cherry picked from commit 8e08b0cc3df904d39da5be38bc345cc701412a9d) --- .../Configuration/ConfigFileProvider.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 4776240fc..75d412b2e 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -211,9 +211,20 @@ public AuthenticationType AuthenticationMethod return AuthenticationType.Forms; } - return Enum.TryParse(_authOptions.Method, out var enumValue) + var value = Enum.TryParse(_authOptions.Method, out var enumValue) ? enumValue : 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; } } @@ -389,6 +400,12 @@ public void MigrateConfigFile() { 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()