mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
NCore: Add 2factor support (#1465)
This commit is contained in:
@@ -99,6 +99,11 @@ namespace Jackett.Indexers
|
|||||||
{ "submit", "Access!" }
|
{ "submit", "Access!" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(configData.TwoFactor.Value))
|
||||||
|
{
|
||||||
|
pairs.Add("2factor", configData.TwoFactor.Value);
|
||||||
|
}
|
||||||
|
|
||||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: SiteLink);
|
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: SiteLink);
|
||||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("profile.php"), () =>
|
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("profile.php"), () =>
|
||||||
{
|
{
|
||||||
|
@@ -13,6 +13,7 @@ namespace Jackett.Models.IndexerConfig.Bespoke
|
|||||||
{
|
{
|
||||||
public StringItem Username { get; private set; }
|
public StringItem Username { get; private set; }
|
||||||
public StringItem Password { get; private set; }
|
public StringItem Password { get; private set; }
|
||||||
|
public StringItem TwoFactor { get; private set; }
|
||||||
public BoolItem Hungarian { get; set; }
|
public BoolItem Hungarian { get; set; }
|
||||||
public BoolItem English { get; set; }
|
public BoolItem English { get; set; }
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ namespace Jackett.Models.IndexerConfig.Bespoke
|
|||||||
{
|
{
|
||||||
Username = new StringItem { Name = "Username", Value = "" };
|
Username = new StringItem { Name = "Username", Value = "" };
|
||||||
Password = new StringItem { Name = "Password", Value = "" };
|
Password = new StringItem { Name = "Password", Value = "" };
|
||||||
|
TwoFactor = new StringItem { Name = "Twofactor", Value = "" };
|
||||||
Hungarian = new BoolItem { Name = "Hungarian", Value = true };
|
Hungarian = new BoolItem { Name = "Hungarian", Value = true };
|
||||||
English = new BoolItem { Name = "English", Value = true };
|
English = new BoolItem { Name = "English", Value = true };
|
||||||
}
|
}
|
||||||
@@ -40,6 +42,9 @@ namespace Jackett.Models.IndexerConfig.Bespoke
|
|||||||
case "Password":
|
case "Password":
|
||||||
Password = new StringItem { Name = propertyName, Value = config.value };
|
Password = new StringItem { Name = propertyName, Value = config.value };
|
||||||
break;
|
break;
|
||||||
|
case "Twofactor":
|
||||||
|
TwoFactor = new StringItem { Name = propertyName, Value = config.value };
|
||||||
|
break;
|
||||||
case "Hungarian":
|
case "Hungarian":
|
||||||
Hungarian = new BoolItem { Name = propertyName, Value = config.value };
|
Hungarian = new BoolItem { Name = propertyName, Value = config.value };
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user