Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
fix captcha bug
Browse files Browse the repository at this point in the history
  • Loading branch information
teknogeek committed Jun 11, 2015
1 parent 50e4aaf commit cc3020a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/snapchat.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ public function register($username, $password, $email, $birthday, $phone_verific
}
$this->auth_token = $result['data']->auth_token;

$auth = $this->getAuthToken();
$this->totArray[1][$this->username] = array($auth, time()+(55*60));
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . self::DATA_FOLDER . DIRECTORY_SEPARATOR . "auth-$this->username.dat", serialize($this->totArray));
if($auth['error'] == 1)
{
return $auth;
}
parent::setGAuth($auth);

$timestamp = parent::timestamp();
parent::post(
'/loq/register_username',
Expand All @@ -474,6 +483,7 @@ public function register($username, $password, $email, $birthday, $phone_verific
array(
$this->auth_token,
$timestamp,
$auth['auth']
),
$multipart = false,
$debug = $this->debug
Expand Down
2 changes: 1 addition & 1 deletion src/snapchat_agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public function post($endpoint, $data, $params, $multipart = FALSE, $debug = FAL
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
}

if($endpoint == "/loq/login")
if($endpoint == "/loq/login" || $endpoint == "/loq/register_username")
{
$headers = array_merge(self::$CURL_HEADERS, array(
"X-Snapchat-Client-Auth-Token: Bearer {$params[2]}",
Expand Down

0 comments on commit cc3020a

Please sign in to comment.