我用seregazhuk / php-pinterest-bot(在Symfony 4中)在Pinterest上添加pin(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."
我已经检查了我的邮件,用户名和密码。我可以与他们成功连接。
怎么了?
看起来你正在使用的lib还没有工作一段时间:
几天前,在新版本5.9.1发布后,问题得以解决。现在,您可以再次使用它。以下方法返回true,因为它应该是:
$res = $bot->auth->login($mail, $pwd); // return true