mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Reset cookies with new logindata
This commit is contained in:
@@ -75,10 +75,16 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public async Task ApplyConfiguration(JToken configJson)
|
public async Task ApplyConfiguration(JToken configJson)
|
||||||
{
|
{
|
||||||
|
cookies = new CookieContainer();
|
||||||
|
client = new HttpClient(handler);
|
||||||
|
|
||||||
|
var configSaveData = new JObject();
|
||||||
|
if (OnSaveConfigurationRequested != null)
|
||||||
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
|
||||||
var config = new ConfigurationDataBasicLogin();
|
var config = new ConfigurationDataBasicLogin();
|
||||||
config.LoadValuesFromJson(configJson);
|
config.LoadValuesFromJson(configJson);
|
||||||
|
|
||||||
var pairs = new Dictionary<string, string> {
|
var pairs = new Dictionary<string, string> {
|
||||||
{ "username", config.Username.Value },
|
{ "username", config.Username.Value },
|
||||||
{ "password", @config.Password.Value },
|
{ "password", @config.Password.Value },
|
||||||
@@ -88,7 +94,8 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
var content = new FormUrlEncodedContent(pairs);
|
var content = new FormUrlEncodedContent(pairs);
|
||||||
var message = CreateHttpRequest(new Uri(LoginUrl));
|
var message = CreateHttpRequest(new Uri(LoginUrl));
|
||||||
//message.Content = content;
|
message.Content = content;
|
||||||
|
|
||||||
//message.Headers.Referrer = new Uri(LoginUrl);
|
//message.Headers.Referrer = new Uri(LoginUrl);
|
||||||
string responseContent;
|
string responseContent;
|
||||||
JArray cookieJArray;
|
JArray cookieJArray;
|
||||||
@@ -119,8 +126,7 @@ namespace Jackett.Indexers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
configSaveData = new JObject();
|
||||||
var configSaveData = new JObject();
|
|
||||||
configSaveData["cookies"] = cookieJArray;
|
configSaveData["cookies"] = cookieJArray;
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
Reference in New Issue
Block a user