{"action":"created","issue":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/159","repository_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files","labels_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/159/comments","events_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/159/events","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/159","id":167181007,"number":159,"title":"Permission checks will fail on cordova because of wrong cookie domain","user":{"login":"menelike","id":4238881,"avatar_url":"https://avatars.githubusercontent.com/u/4238881?v=3","gravatar_id":"","url":"https://api.github.com/users/menelike","html_url":"https://github.com/menelike","followers_url":"https://api.github.com/users/menelike/followers","following_url":"https://api.github.com/users/menelike/following{/other_user}","gists_url":"https://api.github.com/users/menelike/gists{/gist_id}","starred_url":"https://api.github.com/users/menelike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/menelike/subscriptions","organizations_url":"https://api.github.com/users/menelike/orgs","repos_url":"https://api.github.com/users/menelike/repos","events_url":"https://api.github.com/users/menelike/events{/privacy}","received_events_url":"https://api.github.com/users/menelike/received_events","type":"User","site_admin":false},"labels":[{"id":200431642,"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":200431643,"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/help%20wanted","name":"help wanted","color":"bfdadc","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":41,"created_at":"2016-07-23T11:50:27Z","updated_at":"2016-10-28T05:25:13Z","closed_at":null,"body":"Service-side permission checks depending on cookies can not be used within cordova and will fail. Document.cookie can only access `localhost` as cordova connects to `<content src=\"http://localhost:12008/\"/>` where the request for files with go along with the server set my meteor (`--mobile-server`) e.g. `https://foo.bar/cdn/...`.\r\nMight be wort mentioning that we use `Crosswalk`.\r\n\r\nThis may also be related to https://github.com/VeliovGroup/Meteor-Files/issues/97 and http://stackoverflow.com/a/36334857/1981426\r\n\r\nCan someone reproduce this?\r\nIs this even possible to fix without a cordova plugin? \r\n\r\n### Update\r\n\r\nOn deeper inspection I can see that there is client/server handshake which deals with this issue. Still leaves https://github.com/VeliovGroup/Meteor-Files/issues/97#issuecomment-224867402 open.\r\n\r\nHeaders being sent (Chrome Browser):\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4238881/17078405/ac72e80e-50f2-11e6-9816-368c4f83c011.png)\r\n\r\nHeaders being sent (Cordova/Crosswalk) (Cookie is missing):\r\n![image](https://cloud.githubusercontent.com/assets/4238881/17078408/bd41ac38-50f2-11e6-9c7f-8ca148a457e7.png)\r\n\r\n\r\n\r\n**This can be reproduced if ROOT_URL !== `the webpage URL` e.g. 'localhost' !== '127.0.0.1'`**"},"comment":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/comments/256839123","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/159#issuecomment-256839123","issue_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/159","id":256839123,"user":{"login":"menelike","id":4238881,"avatar_url":"https://avatars.githubusercontent.com/u/4238881?v=3","gravatar_id":"","url":"https://api.github.com/users/menelike","html_url":"https://github.com/menelike","followers_url":"https://api.github.com/users/menelike/followers","following_url":"https://api.github.com/users/menelike/following{/other_user}","gists_url":"https://api.github.com/users/menelike/gists{/gist_id}","starred_url":"https://api.github.com/users/menelike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/menelike/subscriptions","organizations_url":"https://api.github.com/users/menelike/orgs","repos_url":"https://api.github.com/users/menelike/repos","events_url":"https://api.github.com/users/menelike/events{/privacy}","received_events_url":"https://api.github.com/users/menelike/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T05:25:12Z","updated_at":"2016-10-28T05:25:12Z","body":"@dr-dimitru \r\n\r\n> Add third argument appendGetAuth to .link() method which will append to links the \"get-authentication\" parameter\r\n\r\nthis should be avoided because\r\n\r\n> ...but this would enforce an explicit compatibility check on every call...ugly and bad developer experience.\r\n\r\nWhy not just something like (just to get the idea)\r\n\r\n```\r\nvar Images = new FilesCollection({\r\n  collectionName: 'Images',\r\n  useGetParameter: () => {\r\n  // now let the developer decide what shall be done, like\r\n  if (Meteor.isServer) {\r\n    return true;\r\n  } else if (Meteor.isCordova) {\r\n    return true\r\n  } else if (foo === bar) {\r\n  return true\r\n  }\r\n  return false\r\n  },\r\n});\r\n```\r\n\r\nper default this functions is `undefined` (do not use get params) or `() => false`;"}}
{"actor":{"display_login":"menelike"}}