{"action":"created","issue":{"url":"https://api.github.com/repos/websanova/vue-auth/issues/58","repository_url":"https://api.github.com/repos/websanova/vue-auth","labels_url":"https://api.github.com/repos/websanova/vue-auth/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/websanova/vue-auth/issues/58/comments","events_url":"https://api.github.com/repos/websanova/vue-auth/issues/58/events","html_url":"https://github.com/websanova/vue-auth/issues/58","id":193438446,"number":58,"title":"auth token is not being set on a valid login request","user":{"login":"murum","id":3242006,"avatar_url":"https://avatars.githubusercontent.com/u/3242006?v=3","gravatar_id":"","url":"https://api.github.com/users/murum","html_url":"https://github.com/murum","followers_url":"https://api.github.com/users/murum/followers","following_url":"https://api.github.com/users/murum/following{/other_user}","gists_url":"https://api.github.com/users/murum/gists{/gist_id}","starred_url":"https://api.github.com/users/murum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murum/subscriptions","organizations_url":"https://api.github.com/users/murum/orgs","repos_url":"https://api.github.com/users/murum/repos","events_url":"https://api.github.com/users/murum/events{/privacy}","received_events_url":"https://api.github.com/users/murum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-05T08:35:57Z","updated_at":"2016-12-05T10:25:57Z","closed_at":null,"body":"Hi!\r\n\r\nI'm having trouble that the auth token is not being set.\r\n\r\n```\r\nimport VueAuth from '@websanova/vue-auth'\r\nimport VueAuthAuth from '@websanova/vue-auth/drivers/auth/bearer.js'\r\nimport VueAuthHttp from '@websanova/vue-auth/drivers/http/vue-resource.1.x.js'\r\nimport VueAuthRouter from '@websanova/vue-auth/drivers/router/vue-router.2.x.js'\r\n\r\nVue.use(VueAuth, {\r\n  auth: VueAuthAuth,\r\n  http: VueAuthHttp,\r\n  router: VueAuthRouter,\r\n  authRedirect: {path: '/'},\r\n  loginData: {'method': 'GET'}\r\n})\r\n```\r\n\r\nMy login request looks like this\r\n```\r\n      login () {\r\n        this.$auth.login({\r\n          params: {\r\n            'hash': '441e542c88445b43831ae845699f413424eae7e3',\r\n            'uid': '148'\r\n          },\r\n          body: this.data.body,\r\n          rememberMe: this.data.rememberMe,\r\n          redirect: {name: 'account'},\r\n          success () {\r\n            console.log('success ' + this.context)\r\n          },\r\n          error (res) {\r\n            console.log('error ' + this.context)\r\n            this.error = res.data\r\n          }\r\n        })\r\n      },\r\n```\r\n\r\nThe response of the login request looks like this\r\n```\r\n{\r\n  status: \"success\",\r\n  token: // Just a valid token\r\n  data: [\r\n    exp: 141239821,\r\n    roles: [4],\r\n    firstname: \"firstname\"\r\n    etc....\r\n  }\r\n}\r\n```\r\n\r\nI guess there should be a token set in the local storage but nothing happens after the login request more than the request return a success object and then nothing else happens. When the `auth/user` request is being made no authorization header is added.\r\n"},"comment":{"url":"https://api.github.com/repos/websanova/vue-auth/issues/comments/264818102","html_url":"https://github.com/websanova/vue-auth/issues/58#issuecomment-264818102","issue_url":"https://api.github.com/repos/websanova/vue-auth/issues/58","id":264818102,"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-12-05T10:25:57Z","updated_at":"2016-12-05T10:25:57Z","body":"It's looking for the token in an \"Authorization\" header not the body (if\nyou are using the bearer driver). To find it in the body you would need to\nwrite a custom auth driver. There are examples in the docs.\n\nOn Mon, Dec 5, 2016 at 3:35 PM, Christoffer Rydberg <\nnotifications@github.com> wrote:\n\n> Hi!\n>\n> I'm having trouble that the auth token is not being set.\n>\n> import VueAuth from '@websanova/vue-auth'\n> import VueAuthAuth from '@websanova/vue-auth/drivers/auth/bearer.js'\n> import VueAuthHttp from '@websanova/vue-auth/drivers/http/vue-resource.1.x.js'\n> import VueAuthRouter from '@websanova/vue-auth/drivers/router/vue-router.2.x.js'\n>\n> Vue.use(VueAuth, {\n>   auth: VueAuthAuth,\n>   http: VueAuthHttp,\n>   router: VueAuthRouter,\n>   authRedirect: {path: '/'},\n>   loginData: {'method': 'GET'}\n> })\n>\n> My login request looks like this\n>\n>       login () {\n>         this.$auth.login({\n>           params: {\n>             'hash': '441e542c88445b43831ae845699f413424eae7e3',\n>             'uid': '148'\n>           },\n>           body: this.data.body,\n>           rememberMe: this.data.rememberMe,\n>           redirect: {name: 'account'},\n>           success () {\n>             console.log('success ' + this.context)\n>           },\n>           error (res) {\n>             console.log('error ' + this.context)\n>             this.error = res.data\n>           }\n>         })\n>       },\n>\n> The response of the login request looks like this\n>\n> {\n>   status: \"success\",\n>   token: // Just a valid token\n>   data: [\n>     exp: 141239821,\n>     roles: [4],\n>     firstname: \"firstname\"\n>     etc....\n>   }\n> }\n>\n> I guess there should be a token set in the local storage but nothing\n> happens after the login request more than the request return a success\n> object and then nothing else happens. When the auth/user request is being\n> made no authorization header is added.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/websanova/vue-auth/issues/58>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABkcy8_c62up0l6Lk1yh-L8qcWlQf1zUks5rE8ztgaJpZM4LD-Ft>\n> .\n>\n\n\n\n-- \nRobert Duchnik\nhttp://www.duchnik.com\n"}}
{"actor":{"display_login":"websanova"}}