{"action":"created","issue":{"url":"https://api.github.com/repos/nuxt-community/auth-module/issues/76","repository_url":"https://api.github.com/repos/nuxt-community/auth-module","labels_url":"https://api.github.com/repos/nuxt-community/auth-module/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/nuxt-community/auth-module/issues/76/comments","events_url":"https://api.github.com/repos/nuxt-community/auth-module/issues/76/events","html_url":"https://github.com/nuxt-community/auth-module/issues/76","id":299331863,"node_id":"MDU6SXNzdWUyOTkzMzE4NjM=","number":76,"title":"I need the token(s) to be fetched from the header instead of data of the request. ","user":{"login":"AhmedAtef07","id":4195363,"node_id":"MDQ6VXNlcjQxOTUzNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4195363?v=4","gravatar_id":"","url":"https://api.github.com/users/AhmedAtef07","html_url":"https://github.com/AhmedAtef07","followers_url":"https://api.github.com/users/AhmedAtef07/followers","following_url":"https://api.github.com/users/AhmedAtef07/following{/other_user}","gists_url":"https://api.github.com/users/AhmedAtef07/gists{/gist_id}","starred_url":"https://api.github.com/users/AhmedAtef07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AhmedAtef07/subscriptions","organizations_url":"https://api.github.com/users/AhmedAtef07/orgs","repos_url":"https://api.github.com/users/AhmedAtef07/repos","events_url":"https://api.github.com/users/AhmedAtef07/events{/privacy}","received_events_url":"https://api.github.com/users/AhmedAtef07/received_events","type":"User","site_admin":false},"labels":[{"id":841883285,"node_id":"MDU6TGFiZWw4NDE4ODMyODU=","url":"https://api.github.com/repos/nuxt-community/auth-module/labels/type:%20feature%20request","name":"type: feature request","color":"ceef15","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-22T12:19:17Z","updated_at":"2018-10-23T14:03:27Z","closed_at":null,"author_association":"NONE","body":"After digging into the lib, I can see that you fetch the token data from a property name from the axios response data, in my case, I want to fetch multiple tokens from the header not the data. I use devise token auth, and I need to store and send `const deviseTokens = ['token-type', 'access-token', 'client', 'uid', 'expiry']`, instead of just 1 token and in the Authorization header.\r\n\r\nI tried to work it around by using a plugin on my own, which adds an axios interceptor to fetch the headers on every response and set it into every request, everything worked fine except for the login (on app init), in the init section you call fetchUser(), and my interceptors won't be there yet, so it will cause a 401. \r\n\r\nI either want: 1. an option to enable/disable the fetchUser() on init, so I can call it myself in the app mounted for example. Or 2. ability to add my interceptors there. Or 3. ability to choose from where to fetch the tokens, and please support the option of having the tokens in multiple properties in the header, not just 1 header field. Or. 4. add support for devise authentication as it is so popular indeed and I see you started to implement login strategies, so it can be one of the strategies. \r\n\r\nThank you so much.\n\n<!--cmty--><!--cmty_prevent_hook-->\n<div align=\"right\"><sub><em>This feature request is available on <a href=\"https://nuxtjs.cmty.io\">Nuxt.js</a> community (<a href=\"https://nuxtjs.cmty.io/nuxt-community/auth-module/issues/c58\">#c58</a>)</em></sub></div>"},"comment":{"url":"https://api.github.com/repos/nuxt-community/auth-module/issues/comments/432260025","html_url":"https://github.com/nuxt-community/auth-module/issues/76#issuecomment-432260025","issue_url":"https://api.github.com/repos/nuxt-community/auth-module/issues/76","id":432260025,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjI2MDAyNQ==","user":{"login":"NickBolles","id":7891759,"node_id":"MDQ6VXNlcjc4OTE3NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/7891759?v=4","gravatar_id":"","url":"https://api.github.com/users/NickBolles","html_url":"https://github.com/NickBolles","followers_url":"https://api.github.com/users/NickBolles/followers","following_url":"https://api.github.com/users/NickBolles/following{/other_user}","gists_url":"https://api.github.com/users/NickBolles/gists{/gist_id}","starred_url":"https://api.github.com/users/NickBolles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickBolles/subscriptions","organizations_url":"https://api.github.com/users/NickBolles/orgs","repos_url":"https://api.github.com/users/NickBolles/repos","events_url":"https://api.github.com/users/NickBolles/events{/privacy}","received_events_url":"https://api.github.com/users/NickBolles/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T14:03:27Z","updated_at":"2018-10-23T14:03:27Z","author_association":"NONE","body":"I second the option to disable fetchUser on init, or at least override it with my own implementation. (i need to do more complex stuff to get the user, don't ask :) )\r\n\r\nIf we have a way to overwrite fetchUser, and have access to a flag saying \"isFirst\" or \"isInit\" or something, ti seems like it would add a ton of flexibility"}}
{"actor":{"display_login":"NickBolles"}}