parse-community / parse-php-sdk

The PHP SDK for Parse Platform
https://parseplatform.org/
Other
812 stars 346 forks source link

ParseUser::become not working #478

Closed MBoberski closed 1 year ago

MBoberski commented 3 years ago

Issue Description

        ParseClient::initialize( '...', '...', '...' );
        ParseClient::setServerURL('...','...');
        ParseClient::setHttpClient(new ParseStreamHttpClient());

        http_response_code(200);

        $health = ParseClient::getServerHealth();
        var_dump($health);

        $user = ParseUser::become("r:471d5035f17c048532c7c8d3c4319102");
        var_dump($user);

var_dump($health); - is showing: array(2) { ["status"]=> int(200) ["response"]=> array(1) { ["status"]=> string(2) "ok" } } but var_dump($user); or any code below that is not showing any result

Steps to reproduce

~~ Please provide the necessary steps here to reproduce this when possible ~~

Environment Details

MBoberski commented 3 years ago

Now I get:

Parse\ParseException: unauthorized in /var/www/sites/expij.online/html/main/vendor/parse/php-sdk/src/Parse/ParseClient.php:604 Stack trace: #0 /var/www/sites/expij.online/html/main/vendor/parse/php-sdk/src/Parse/ParseUser.php(460): Parse\ParseClient::_request() #1 /var/www/sites/expij.online/html/main/plugins/components/expij.online/nosubdomain/json/content/controller/ContentController.class.php(509): Parse\ParseUser::become() #2 /var/www/sites/expij.online/html/main/core/mvc/Controller.class.php(23): ContentController->GETtestAction() #3 /var/www/sites/expij.online/html/main/core/MainController.class.php(22): Controller->doAction() #4 /var/www/sites/expij.online/html/main/core/MainController.class.php(14): MainController->chooseAction() #5 /var/www/sites/expij.online/html/main/core/UnicornEngine.class.php(22): MainController->doAction() #6 /var/www/sites/expij.online/html/main/index.php(52): UnicornEngine->run() #7 {main}

but I have all the keys at init.