{"action":"created","issue":{"url":"https://api.github.com/repos/markhuot/craftql/issues/158","repository_url":"https://api.github.com/repos/markhuot/craftql","labels_url":"https://api.github.com/repos/markhuot/craftql/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/markhuot/craftql/issues/158/comments","events_url":"https://api.github.com/repos/markhuot/craftql/issues/158/events","html_url":"https://github.com/markhuot/craftql/issues/158","id":361349877,"node_id":"MDU6SXNzdWUzNjEzNDk4Nzc=","number":158,"title":"Error: message: Not authorized using default curl command","user":{"login":"swthate","id":4054580,"node_id":"MDQ6VXNlcjQwNTQ1ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/4054580?v=4","gravatar_id":"","url":"https://api.github.com/users/swthate","html_url":"https://github.com/swthate","followers_url":"https://api.github.com/users/swthate/followers","following_url":"https://api.github.com/users/swthate/following{/other_user}","gists_url":"https://api.github.com/users/swthate/gists{/gist_id}","starred_url":"https://api.github.com/users/swthate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swthate/subscriptions","organizations_url":"https://api.github.com/users/swthate/orgs","repos_url":"https://api.github.com/users/swthate/repos","events_url":"https://api.github.com/users/swthate/events{/privacy}","received_events_url":"https://api.github.com/users/swthate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-09-18T15:02:45Z","updated_at":"2018-10-06T19:02:09Z","closed_at":null,"author_association":"NONE","body":"This is similar to issue #56 \r\n\r\nCraft CMS: 3.0.24\r\nCraftQL: 1.1.0\r\nPHP: 7.1.1\r\n\r\nThis is on a local project running on MAMP Pro. My PHP is set to CGI mode. As far as I can tell it's not in Fast CGI mode (i.e. `fastcgi.impersonate = 1;` is commented-out).\r\n\r\nI have been working on trying to get a basic Vue component to communicate with CraftQL via Axios. The javascript I wrote has nothing to do with this, I think, but here's what I have in case any helpful soul notices any blatant errors in that, too!\r\n\r\n```javascript\r\n// Information needed for connecting to CraftQL endpoint\r\nconst token = 'F--ybXjDAsXd7sqlKd-hudg6VedYh2fjyzyGbUEtl2zlLxO1DAaSfkxQ4WBPiL10';\r\nconst url = 'http://dstnew.test/api';\r\n\r\n// GraphQL query\r\nconst query = `\r\n    {\r\n        query businesses(section:[businesses], limit:1) {\r\n            ...on Businesses {\r\n                id\r\n                title\r\n                bizTown {\r\n                    title\r\n                }\r\n            }\r\n        }\r\n    }\r\n`;\r\n\r\n\r\nconst axiosCraftQL = axios.create({\r\n    baseURL: 'http://dstnew.test/api',\r\n    headers: {\r\n        'Authorization': `Bearer: ${token}`,\r\n        'X-Requested-With': 'XMLHttpRequest'\r\n    }\r\n});\r\n\r\n\r\nnew Vue({\r\n    el: '#app',\r\n    delimiters: [ '${', '}' ],\r\n    data: {\r\n        businesses: {}\r\n    },\r\n    mounted() {\r\n        axiosCraftQL\r\n            .get('', { query: query })\r\n            .then(console.log(result));\r\n    }\r\n});\r\n```\r\n\r\nI first noticed something odd when my javascript console returned the following:\r\n\r\n`spread.js:25 GET http://dstnew.test/api 404 (Not Found)`\r\n\r\nThen I tried running the sample Curl statement from the plugin settings page. I tried it with a lowercase `Authorization` and ensured the url in the command and in my site's settings match. The command returns the following:\r\n\r\n`{\"errors\":[{\"message\":\"Not authorized\"}]}`\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/markhuot/craftql/issues/comments/427598458","html_url":"https://github.com/markhuot/craftql/issues/158#issuecomment-427598458","issue_url":"https://api.github.com/repos/markhuot/craftql/issues/158","id":427598458,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzU5ODQ1OA==","user":{"login":"swthate","id":4054580,"node_id":"MDQ6VXNlcjQwNTQ1ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/4054580?v=4","gravatar_id":"","url":"https://api.github.com/users/swthate","html_url":"https://github.com/swthate","followers_url":"https://api.github.com/users/swthate/followers","following_url":"https://api.github.com/users/swthate/following{/other_user}","gists_url":"https://api.github.com/users/swthate/gists{/gist_id}","starred_url":"https://api.github.com/users/swthate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swthate/subscriptions","organizations_url":"https://api.github.com/users/swthate/orgs","repos_url":"https://api.github.com/users/swthate/repos","events_url":"https://api.github.com/users/swthate/events{/privacy}","received_events_url":"https://api.github.com/users/swthate/received_events","type":"User","site_admin":false},"created_at":"2018-10-06T19:02:09Z","updated_at":"2018-10-06T19:02:09Z","author_association":"NONE","body":"@markhuot and @magicspon :\r\n\r\nI just finished upgrading to Mojave. I also upgraded from MAMP PRO 4.x to 5.x.\r\n\r\nI wish I knew what changed or fixed it... but the sample `curl` statement now successfully returns the `helloWorld` object! Now it's on to the nitty-gritty of actually learning Vue and GraphQL!"}}
{"actor":{"display_login":"swthate"}}