diff --git a/lib/schemes/local.js b/lib/schemes/local.js index 76ace294e..1321aef3a 100644 --- a/lib/schemes/local.js +++ b/lib/schemes/local.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) } } diff --git a/test/module.test.js b/test/module.test.js index a8a894e44..5f2a1ca5d 100644 --- a/test/module.test.js +++ b/test/module.test.js @@ -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')