Skip to content

Commit

Permalink
fix(local-scheme-token): avoid token type duplicata on Axios requests
Browse files Browse the repository at this point in the history
fix(local-scheme-token): avoid token type duplicata on Axios requests
  • Loading branch information
breakingrobot authored Apr 3, 2018
2 parents 42882ef + 6cd2ab5 commit 3908563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/schemes/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 2 additions & 0 deletions test/module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 3908563

Please sign in to comment.