{"action":"closed","issue":{"url":"https://api.github.com/repos/dingo/api/issues/739","repository_url":"https://api.github.com/repos/dingo/api","labels_url":"https://api.github.com/repos/dingo/api/issues/739/labels{/name}","comments_url":"https://api.github.com/repos/dingo/api/issues/739/comments","events_url":"https://api.github.com/repos/dingo/api/issues/739/events","html_url":"https://github.com/dingo/api/issues/739","id":118403102,"number":739,"title":"Middleware api.auth not doing it's job properly.","user":{"login":"zanechua","id":4265429,"avatar_url":"https://avatars.githubusercontent.com/u/4265429?v=3","gravatar_id":"","url":"https://api.github.com/users/zanechua","html_url":"https://github.com/zanechua","followers_url":"https://api.github.com/users/zanechua/followers","following_url":"https://api.github.com/users/zanechua/following{/other_user}","gists_url":"https://api.github.com/users/zanechua/gists{/gist_id}","starred_url":"https://api.github.com/users/zanechua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanechua/subscriptions","organizations_url":"https://api.github.com/users/zanechua/orgs","repos_url":"https://api.github.com/users/zanechua/repos","events_url":"https://api.github.com/users/zanechua/events{/privacy}","received_events_url":"https://api.github.com/users/zanechua/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dingo/api/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dingo/api/milestones/1","html_url":"https://github.com/dingo/api/milestones/v1.0.0","labels_url":"https://api.github.com/repos/dingo/api/milestones/1/labels","id":1472271,"number":1,"title":"v1.0.0","description":"It's been a long time coming, and there's been a few hiccups along the way, but hoping to get a stable 1.0.0 out earlier in the new year.\r\n\r\nThe package as it is is mostly stable, with several bugs cropping up here and there, however I am pleased with where it's at.\r\n\r\nI do not plan to add any more major features, just improve upon what is there until 1.0.0 is tagged.","creator":{"login":"jasonlewis","id":829059,"avatar_url":"https://avatars.githubusercontent.com/u/829059?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonlewis","html_url":"https://github.com/jasonlewis","followers_url":"https://api.github.com/users/jasonlewis/followers","following_url":"https://api.github.com/users/jasonlewis/following{/other_user}","gists_url":"https://api.github.com/users/jasonlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonlewis/subscriptions","organizations_url":"https://api.github.com/users/jasonlewis/orgs","repos_url":"https://api.github.com/users/jasonlewis/repos","events_url":"https://api.github.com/users/jasonlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jasonlewis/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":5,"state":"open","created_at":"2015-12-23T07:20:13Z","updated_at":"2016-03-10T03:20:40Z","due_on":"2016-02-06T13:00:00Z","closed_at":null},"comments":10,"created_at":"2015-11-23T15:19:39Z","updated_at":"2016-03-10T03:20:40Z","closed_at":"2016-03-10T03:20:40Z","body":"I have just utilised this package to create an api for one of my projects but realise that the middleware api.auth is not doing it's job properly.\r\n\r\n    Routes:\r\n    $api->get('company/{company}', 'CompanyController@getCompany');\r\n\r\n    CompanyController:\r\n    public function getCompany(Company $company)\r\n\t{ \r\n\t\treturn response()->json($company);\r\n\t}\r\n\r\nThe above is an example of my routes so I would need to do a get request to http://localhost/api/company/id\r\n\r\nThe expected response if the company does not exist at the id is a 401 if I did not supply a token. However in this case it's returning a 404 Not Found.\r\n\r\nWhat this does is tells the requester whether there is a record found or not. If i send a request with a record of 1 and there is a record with the ID 1 but i fail to supply the JWT Token, It returns me a 401 which is the correct response.\r\n\r\nWhy is api.auth not working and returning a 404 instead of a 401 on my routes if the record does not exist at the ID, It shouldn't even let the query be ran without Token and it should instantly return a 401.\r\n\r\nIs this intended to work like this or?"}}