{"action":"created","issue":{"url":"https://api.github.com/repos/websanova/vue-auth/issues/43","repository_url":"https://api.github.com/repos/websanova/vue-auth","labels_url":"https://api.github.com/repos/websanova/vue-auth/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/websanova/vue-auth/issues/43/comments","events_url":"https://api.github.com/repos/websanova/vue-auth/issues/43/events","html_url":"https://github.com/websanova/vue-auth/issues/43","id":187497667,"number":43,"title":"Role Login routing not working","user":{"login":"kyoukhana","id":756849,"avatar_url":"https://avatars.githubusercontent.com/u/756849?v=3","gravatar_id":"","url":"https://api.github.com/users/kyoukhana","html_url":"https://github.com/kyoukhana","followers_url":"https://api.github.com/users/kyoukhana/followers","following_url":"https://api.github.com/users/kyoukhana/following{/other_user}","gists_url":"https://api.github.com/users/kyoukhana/gists{/gist_id}","starred_url":"https://api.github.com/users/kyoukhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyoukhana/subscriptions","organizations_url":"https://api.github.com/users/kyoukhana/orgs","repos_url":"https://api.github.com/users/kyoukhana/repos","events_url":"https://api.github.com/users/kyoukhana/events{/privacy}","received_events_url":"https://api.github.com/users/kyoukhana/received_events","type":"User","site_admin":false},"labels":[{"id":375749356,"url":"https://api.github.com/repos/websanova/vue-auth/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":28,"created_at":"2016-11-05T13:40:43Z","updated_at":"2016-11-09T01:24:44Z","closed_at":null,"body":"When a user logins successfully i get the following returned data. \r\n```\r\n{\"token\":\"TOKENKEY\",\"roles\":\"2\"}\r\n```\r\nMy Auth Options\r\nLogin Data returns both token and roles\r\n\r\n```\r\nvar options = {\r\n    token: [{name: 'token', authType: 'bearer', foundIn: 'response'}],\r\n    loginData: {url: 'api/auth', method: 'POST', redirect: 'dashboard'},\r\n    fetchData: {url: 'api/acnt', method: 'GET'},\r\n    rolesVar: 'roles'\r\n};\r\n```\r\n\r\n\r\n\r\nIn My routing i have the following routes\r\n\r\n```\r\nVue.router.map({\r\n    '/auth/login': {\r\n        component: (resolve) => { require(['./components/views/login.vue'], resolve); }\r\n},\r\n\r\n'dashboard': {\r\n    auth: [\"1\"],\r\n    name:\"dashboard\",\r\n        component: (resolve) => { require(['./components/views/dashboard.vue'], resolve); }\r\n});\r\n```\r\n\r\nIt Doesn't Route to the dashboard.  If I remove auth: [\"1\"]  to auth:true.  It works.  I am getting the following error\r\n\r\n```\r\nTypeError: this.watch.data is undefined\r\n[Learn More]app.js:15062:58\r\n[vue-router] Uncaught error during transition: \r\n```\r\n\r\nhere is a list of vue resources i am using\r\n\r\n```\r\n\"@websanova/vue-auth\": \"^1.4.0-beta\",\r\n    \"vue\": \"^1.0.26\",\r\n    \"vue-hot-reload-api\": \"^2.0.6\",\r\n    \"vue-html-loader\": \"1.2.3\",\r\n    \"vue-loader\": \"8.5.4\",\r\n    \"vue-mdl\": \"^0.9.4\",\r\n    \"vue-resource\": \"^1.0.3\",\r\n    \"vue-router\": \"^0.7.13\",\r\n    \"vue-strap\": \"^1.0.11\",\r\n    \"vue-style-loader\": \"^1.0.0\",\r\n    \"vuex\": \"^1.0.0-rc.2\",\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/websanova/vue-auth/issues/comments/259311492","html_url":"https://github.com/websanova/vue-auth/issues/43#issuecomment-259311492","issue_url":"https://api.github.com/repos/websanova/vue-auth/issues/43","id":259311492,"user":{"login":"websanova","id":1645771,"avatar_url":"https://avatars.githubusercontent.com/u/1645771?v=3","gravatar_id":"","url":"https://api.github.com/users/websanova","html_url":"https://github.com/websanova","followers_url":"https://api.github.com/users/websanova/followers","following_url":"https://api.github.com/users/websanova/following{/other_user}","gists_url":"https://api.github.com/users/websanova/gists{/gist_id}","starred_url":"https://api.github.com/users/websanova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/websanova/subscriptions","organizations_url":"https://api.github.com/users/websanova/orgs","repos_url":"https://api.github.com/users/websanova/repos","events_url":"https://api.github.com/users/websanova/events{/privacy}","received_events_url":"https://api.github.com/users/websanova/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T01:24:44Z","updated_at":"2016-11-09T01:24:44Z","body":"~~~\r\nauthType: 'custom1',\r\n    custom1Auth: {\r\n        request: function (req, token) {\r\n            req.headers.set('SomeHeader', token);\r\n        },\r\n        response: function (res) {\r\n\r\n            return (res.data.token || {});\r\n        }\r\n    }\r\n~~~\r\n\r\nDid you actually leave it as \"SomeHeader\"? It \"should\" be `Authorization`, but depends what you have setup."}}
{"actor":{"display_login":"websanova"}}