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

FatalErrorException in AccessTokenController.php line 27: syntax error, unexpected '[' #13

Closed
Tellurian7 opened this issue Dec 13, 2016 · 6 comments

Comments

@Tellurian7
Copy link

Tellurian7 commented Dec 13, 2016

Hi,

I'm using PHP v 5.6.28 and i get this error when i call oath/token (POST) :

Syntax at line 27 in vendor\dusterio\lumen-passport\src\Http\Controllers\AccessTokenController.php is not supported

$clientId = array_key_exists('client_id', (array) $request->getParsedBody())
                ? ((array) $request->getParsedBody())['client_id'] : null;

Replace by

$requestBodyArray = ((array) $request->getParsedBody());
$clientId = array_key_exists('client_id', $requestBodyArray) ? $requestBodyArray['client_id'] : null;

and it works.

Do i need a specific PHP configruation or something ? (array casting in ternary condition ?)
Thanks.

@paolopiccinini
Copy link

paolopiccinini commented Dec 13, 2016

the right issuse above

@Tellurian7
Copy link
Author

Tellurian7 commented Dec 13, 2016

I'm using the latest version of lumen-passport, without the PHP7 ?? code and the array casting in ternary condition fail (syntax error)

@paolopiccinini
Copy link

I'm so sorry. I've linked the wrong issue. #10

@Tellurian7
Copy link
Author

No problem :) I didn't notice this issue was already reported.

@himanshusinghs
Copy link

himanshusinghs commented Dec 21, 2016

@paolopiccinini @Tellurian7 @dusterio

I am facing 500 Internal Server Error on /oauth/token route with grant type password. But I can see my route here in routes list.
image

@paolopiccinini
Copy link

what are log saying? go in yourApp/storage/logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants