When a token is added manually Axios doesn't attach the token. As for my auth flow it is required.
When setting a token manually using $auth.setToken calling this.$auth.ctx.app.$axios.setHeader(this.options.tokenName, token) this would solves the manual login problem.
I also need this feature for registering in or logging in via a password reset.
I got around this by using:
this.$auth.setToken(this.$store.state.auth.strategy, `Bearer ${data.access_token}`)
this.$auth.strategy._setToken(`Bearer ${data.access_token}`)
return this.$auth.fetchUser()
I am going to open a PR with this as a helper function.
** edit
https://github.com/nuxt-community/auth-module/pull/278
This issue is not resolved by #278. setUserToken() works just fine on it's own, but setToken() still doesn't set the axios auth token.
Closing here as auth v5 can set tokens using this.$auth.strategy.token.set(...)
Most helpful comment
I also need this feature for registering in or logging in via a password reset.
I got around this by using:
I am going to open a PR with this as a helper function.
** edit
https://github.com/nuxt-community/auth-module/pull/278