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

Update TokenGuard.php #861

Merged
merged 2 commits into from
Oct 30, 2018
Merged

Update TokenGuard.php #861

merged 2 commits into from
Oct 30, 2018

Conversation

yaroslawww
Copy link
Contributor

Prevent passing empty string variable to retrieveById method.
If use middleware 'auth:api' but pass BearerToken form 'grant_type' => 'client_credentials'. PostgreSql will throw exception:
"SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" (SQL: select * from "users" where "id" = limit 1)
It is preferable to transfer null to return 401 (Unauthenticated) in this case

Prevent passing empty string variable to retrieveById method.
If use middleware 'auth:api' but pass BearerToken form 'grant_type' => 'client_credentials'. PostgreSql will throw exception:
"SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: \"\" (SQL: select * from \"users\" where \"id\" =  limit 1)
It is preferable to transfer null to return 401 (Unauthenticated) in this case
@taylorotwell taylorotwell merged commit 039de8b into laravel:7.0 Oct 30, 2018
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

Successfully merging this pull request may close these issues.

2 participants