-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I was receiving this error during login:
PHP Fatal error: Uncaught JsonException: Syntax error in /home/shafeey/fut-api/src/Api/AbstractCore.php:339
Stack trace:
#0 /home/shafeey/fut-api/src/Api/AbstractCore.php(339): json_decode('', true, 512, 4194304)
#1 /home/shafeey/fut-api/test.php(37): Shapecode\FUT\Client\Api\AbstractCore->login('881689')
As I looked deeper, I found that the POST request to "https://utas.external.s2.fut.ea.com:443/ut/auth?client=webcomp" is returning 403 FORBIDDEN with an empty body, which in turn results in the json_decode() exception.
fut-api/src/Api/AbstractCore.php
Line 313 in 4df924c
| $call = $this->simpleRequest('POST', $this->getFutAuthUrl(), [ |
I'm using the following script for login and putting the code from verification email. Any idea what I am doing wrong? Thank you.
<?php
// Autoload files using the Composer autoloader.
require_once __DIR__ . '/vendor/autoload.php';
use Shapecode\FUT\Client\Api\Core;
use Shapecode\FUT\Client\Exception\FutError;
use Shapecode\FUT\Client\Authentication\Account;
use Shapecode\FUT\Client\Authentication\Credentials;
use Shapecode\FUT\Client\Authentication\Session;
$email = "email@email.com";
$password = "PASSWD";
$platform = "ps4";
$code = "999999";
$credentials = new Credentials($email, $password, $platform);
$session = null;
$account = new Account($credentials, $session);
$fut = new Core($account);
try {
$login = $fut->login($code);
$session = $account->getSession();
} catch(FutError $e) {
$reason = $e->getReason();
die("We have an error logging in: ".$reason);
}
echo "Login complete...\n";
Metadata
Metadata
Assignees
Labels
No labels