Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$this->access_token is an array, not object #85

Merged
merged 1 commit into from
Jun 9, 2016
Merged

Conversation

dev101
Copy link
Contributor

@dev101 dev101 commented Jun 9, 2016

As requestBuilder->call applies json_decode($body, true);

if you ever tested it, you'd get

Trying to get property of non-object in auth0\auth0-php\src\Auth0AuthApi.php on line 261

As requestBuilder->call applies json_decode($body, true);
@glena glena merged commit 7056b9c into auth0:master Jun 9, 2016
@glena
Copy link
Contributor

glena commented Jun 9, 2016

thx :)

@glena
Copy link
Contributor

glena commented Jun 9, 2016

published 3.3.6

@dev101
Copy link
Contributor Author

dev101 commented Jun 9, 2016

Even with this fix Auth0AuthApi->impersonate() doesn't work because that json_decode($body, true) is decoding a plain-text URL returned by api (not a json object), which always results in empty string. I leave it to you German.

@dev101
Copy link
Contributor Author

dev101 commented Jun 9, 2016

I guess in the requestBuilder->call you need to sniff the Content-Type returned by the api, and only apply json_decode if the response is actually json.

@glena
Copy link
Contributor

glena commented Jun 9, 2016

yes, I am pushing the change

@dev101
Copy link
Contributor Author

dev101 commented Jun 9, 2016

Like this
return strpos($response->getHeaderLine('content-type'), 'json') !== FALSE ? json_decode($body, true) : $body;

@glena
Copy link
Contributor

glena commented Jun 9, 2016

check 3.3.7

@dev101
Copy link
Contributor Author

dev101 commented Jun 9, 2016

✌️

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants