PHP中的API Pinterest-登录失败

时间:2019-02-05 22:31:34

标签: php pinterest

我使用seregazhuk / php-pinterest-bot(在Symfony 4中)在Pinterest(v5.9.0)上添加了图钉。当我尝试登录时,出现故障。这是我的代码:

    $mail = getenv("PINTEREST_MAIL");
    $pwd = getenv("PINTEREST_PASSWORD");

    $bot = PinterestBot::create();
    $res = $bot->auth->login($mail, $pwd); // return false

    $bot->getLastError(); // return NULL

    $boards = $bot->boards->forUser($username); // failed

当我查看日志时,出现以下错误:

Uncaught PHP Exception seregazhuk\PinterestBot\Exceptions\AuthRequired: "Error calling seregazhuk\PinterestBot\Api\Providers\Pins::create method. You must log in before."

我已经检查了我的邮件,我的用户名和密码。我可以与他们成功建立联系。

怎么了?

2 个答案:

答案 0 :(得分:1)

看起来您正在使用的lib一段时间没有工作:

https://github.com/seregazhuk/php-pinterest-bot/issues/442

答案 1 :(得分:0)

几天前,在发行新版本5.9.1之后,问题已解决。现在,您可以再次使用它。以下方法应返回true:

$res = $bot->auth->login($mail, $pwd); // return true