我正在使用Firebase进行身份验证。当我尝试使用Firebase PHP SDK更改密码时,出现以下错误
致命错误:未捕获的GuzzleHttp \ Exception \ ClientException:客户端 错误:
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo
导致400 Bad Request
响应:{“错误”:{“代码”:400, “ message”:“收到无效的JSON有效负载。未知名称” localId“: 原型字段位于(被截断...) /home/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 堆栈跟踪:#0 /home/nucalmdev/wp/wp-content/themes/enfold-child/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp \ Exception \ RequestException :: create(Object(GuzzleHttp \ Psr7 \ Request), 对象(GuzzleHttp \ Psr7 \ Response))#1 /home/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp \ Middleware :: GuzzleHttp {closure}(Object(GuzzleHttp \ Psr7 \ Response)) #2 /home/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp \ Promise \ Promise :: callHandler(1, 对象(GuzzleHttp \ Psr7 \ Response),在 /home/vendor/kreait/firebase-php/src/Firebase/Exception/AuthException.php 在第53行
我正在使用以下功能:
$auth = $firebase->getAuth();
$get_firebase_user = $auth->getUserByEmail($email);
$uid = $get_firebase_user->uid;
$updatedUser = $auth->changeUserPassword($uid, $password);