{"action":"opened","issue":{"url":"https://api.github.com/repos/mhagmajer/server-router/issues/2","repository_url":"https://api.github.com/repos/mhagmajer/server-router","labels_url":"https://api.github.com/repos/mhagmajer/server-router/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mhagmajer/server-router/issues/2/comments","events_url":"https://api.github.com/repos/mhagmajer/server-router/issues/2/events","html_url":"https://github.com/mhagmajer/server-router/issues/2","id":236692844,"number":2,"title":"userId = null on external request","user":{"login":"mfranzs","id":953103,"avatar_url":"https://avatars2.githubusercontent.com/u/953103?v=3","gravatar_id":"","url":"https://api.github.com/users/mfranzs","html_url":"https://github.com/mfranzs","followers_url":"https://api.github.com/users/mfranzs/followers","following_url":"https://api.github.com/users/mfranzs/following{/other_user}","gists_url":"https://api.github.com/users/mfranzs/gists{/gist_id}","starred_url":"https://api.github.com/users/mfranzs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfranzs/subscriptions","organizations_url":"https://api.github.com/users/mfranzs/orgs","repos_url":"https://api.github.com/users/mfranzs/repos","events_url":"https://api.github.com/users/mfranzs/events{/privacy}","received_events_url":"https://api.github.com/users/mfranzs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-18T00:54:27Z","updated_at":"2017-06-18T00:54:27Z","closed_at":null,"body":"I'm trying to use this package to set up an externally accessible API where a consumer accesses mysite.com/api_endpoint and the server returns a response. I want the server's response to depend on the current logged in user's ID (the API call is coming from a browser in which the user is logged into mysite.com).\r\n\r\nHowever, when accessed in the route method, _this.userId_ is null. Looking through the code, I think it might be because of this line:\r\n\r\nhttps://github.com/mhagmajer/server-router/blob/0eb7746c86f83c0d061714264b85da279a878a98/src/server/server-router.js#L342\r\n\r\nWhy is this setup this way? Can you not get userId's in this manner? I thought that this functionality is what separated this package from something like Picker.\r\n\r\nCode for reference:\r\n```\r\nconst serverRouter = new ServerRouter();\r\nWebApp.connectHandlers.use(serverRouter.middleware);\r\n\r\nserverRouter.addPath({\r\n  path: '/api_endpoint',\r\n  args: (() => {}),\r\n  async route() {\r\n    this.res.end(this.userId+ \"test\");\r\n  },\r\n});\r\n```"}}
{"actor":{"display_login":"mfranzs"}}