Skip to content

Commit

Permalink
fix(token): fix strategy options
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAS51 committed Mar 11, 2020
1 parent f7bf444 commit 994db50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/core/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export class Token {
_setHeader (token) {
if (this.$auth.options.globalToken) {
// Set Authorization token for all axios requests
this.$auth.ctx.app.$axios.setHeader(this.$auth.scheme.options.token.name, token)
this.$auth.ctx.app.$axios.setHeader(this.$auth.strategy.options.token.name, token)
}
}

_clearHeader () {
if (this.$auth.options.globalToken) {
// Clear Authorization token for all axios requests
this.$auth.ctx.app.$axios.setHeader(this.$auth.scheme.options.token.name, false)
this.$auth.ctx.app.$axios.setHeader(this.$auth.strategy.options.token.name, false)
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ export class Token {
}

set (tokenValue) {
const token = addTokenPrefix(tokenValue, this.$auth.scheme.options.token.type)
const token = addTokenPrefix(tokenValue, this.$auth.strategy.options.token.type)

this._setToken(token)
this._setHeader(token)
Expand Down Expand Up @@ -173,7 +173,7 @@ export class RefreshToken {
}

set (tokenValue) {
const refreshToken = addTokenPrefix(tokenValue, this.$auth.scheme.options.refreshToken.type)
const refreshToken = addTokenPrefix(tokenValue, this.$auth.strategy.options.refreshToken.type)

this._setToken(refreshToken)
this._updateExpiration(refreshToken)
Expand Down

0 comments on commit 994db50

Please sign in to comment.