Permalink
Browse files

fix(local-scheme-token): avoid token type duplicata on Axios requests

fix(local-scheme-token): avoid token type duplicata on Axios requests
  • Loading branch information...
breakingrobot committed Apr 3, 2018
2 parents 42882ef + 6cd2ab5 commit 39085637fc1f4ebf2538e2d9243e1f5f16919b5e
Showing with 3 additions and 1 deletion.
  1. +1 −1 lib/schemes/local.js
  2. +2 −0 test/module.test.js
@@ -9,7 +9,7 @@ export default class LocalScheme {
_setToken (token) {
if (this.options.globalToken) {
// Set Authorization token for all axios requests
this.$auth.ctx.app.$axios.setToken(token, this.options.tokenType)
this.$auth.ctx.app.$axios.setToken(token)
}
}
@@ -53,6 +53,8 @@ describe('auth', () => {
})
expect(axiosBearer).toBeDefined()
expect(axiosBearer.split(' ')).toHaveLength(2)
expect(axiosBearer.split(' ')[0]).toMatch(/^Bearer$/i)
expect(token).toBeDefined()
expect(user).toBeDefined()
expect(user.username).toBe('test_username')

0 comments on commit 3908563

Please sign in to comment.