Skip to content

Commit 3908563

Browse files
fix(local-scheme-token): avoid token type duplicata on Axios requests
fix(local-scheme-token): avoid token type duplicata on Axios requests
2 parents 42882ef + 6cd2ab5 commit 3908563

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/schemes/local.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class LocalScheme {
99
_setToken (token) {
1010
if (this.options.globalToken) {
1111
// Set Authorization token for all axios requests
12-
this.$auth.ctx.app.$axios.setToken(token, this.options.tokenType)
12+
this.$auth.ctx.app.$axios.setToken(token)
1313
}
1414
}
1515

test/module.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ describe('auth', () => {
5353
})
5454

5555
expect(axiosBearer).toBeDefined()
56+
expect(axiosBearer.split(' ')).toHaveLength(2)
57+
expect(axiosBearer.split(' ')[0]).toMatch(/^Bearer$/i)
5658
expect(token).toBeDefined()
5759
expect(user).toBeDefined()
5860
expect(user.username).toBe('test_username')

0 commit comments

Comments
 (0)