Skip to content

Commit

Permalink
fix issues the original PR 278 has
Browse files Browse the repository at this point in the history
- remove the logging out as we will overwrite the token anyways and it introduced unexpected and unwanted behaviour
- remove check if we need to use token. this functions purpose is to set the token, so we will always do it
  • Loading branch information
maybeanerd committed Feb 13, 2020
1 parent 8546634 commit 5d726b6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/schemes/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,11 @@ export default class LocalScheme {
}

async setUserToken (tokenValue) {
// Ditch any leftover local tokens before attempting to log in
await this._logoutLocally()

if (this.options.tokenRequired) {
const token = this.options.tokenType
? this.options.tokenType + ' ' + tokenValue
: tokenValue

this.$auth.setToken(this.name, token)
this._setToken(token)
}
const token = this.options.tokenType
? this.options.tokenType + ' ' + tokenValue
: tokenValue
this.$auth.setToken(this.name, token)
this._setToken(token)

return this.fetchUser()
}
Expand Down

0 comments on commit 5d726b6

Please sign in to comment.