Skip to content
Permalink
Browse files
fix: fix setUserToken issues (#528)
fixes #278
  • Loading branch information
pi0 committed Mar 2, 2020
2 parents fb63f6f + 5d726b6 commit 02d14ac5695c5797e290ce9494d0c0451fbf5296
Showing 1 changed file with 5 additions and 11 deletions.
@@ -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()
}

0 comments on commit 02d14ac

Please sign in to comment.