jadjoubran / laravel5-angular-material-starter

Get started with Laravel 5.3 and AngularJS (material)
https://laravel-angular.readme.io/
MIT License
1.66k stars 400 forks source link

Remove token query param on get, post, put, delete and custom request functions and add as auth headers #401

Closed bradiosd closed 8 years ago

bradiosd commented 8 years ago

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behaviour? (You can also link to an open issue here) When attempting to do a POST request with empty or non-empty data the Illuminate Foundation Testing function converts all query params into POST data. Even though query param remains on the URI, the token is passed as POST data too.

My application has no restriction on what params can be passed which resulted in a "token" column not found exception.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'token' in 'field list'

What is the new behaviour? I have removed the token being sent through the URI and it is now passed into the request headers. I can't see any reason why this would break anyones application and tokens should really be passed this way in the first instance.

Does this PR introduce a breaking change?

Other information: No issue created as I found the bug and fixed it myself.

jadjoubran commented 8 years ago

Looks great, thanks @bradbird1990 😄 I remember having this issue before

bradiosd commented 8 years ago

Woo thanks! Glad you like @jadjoubran. Never had a successful merge from a pull request before :).

jadjoubran commented 8 years ago

awesome @bradbird1990 😄