From: Stricted Date: Sat, 17 Jun 2017 13:48:32 +0000 (+0200) Subject: fix login logic again X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=36484600d25a9eddad1018c142c9b648a33dddaf;p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git fix login logic again --- diff --git a/lib/trait/Login.class.php b/lib/trait/Login.class.php index 737106c..bfbb276 100644 --- a/lib/trait/Login.class.php +++ b/lib/trait/Login.class.php @@ -49,12 +49,11 @@ trait Login { $fields = array('csrf_token' => 'nulltoken', "challengev" => $this->challenge, 'showpw' => 0, 'password' => $this->hash); $data = $this->sendRequest($path, $fields); $json = $this->getValues($data['body']); - if (!in_array("challenge", $json)) { + if (array_key_exists("challengev", $json)) { $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash); $data = $this->sendRequest($path, $fields); $json = $this->getValues($data['body']); } - if (isset($json['login']) && $json['login'] == 'success') { $this->cookie = $this->getCookie($data);