Skip to content

Commit

Permalink
fix: logout locally before logging in. fixes #136. (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedantic-git authored and pi0 committed Apr 20, 2018
1 parent 34d539e commit b6cfad4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/schemes/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export default class LocalScheme {
return
}

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

const result = await this.$auth.request(
endpoint,
this.options.endpoints.login
Expand Down Expand Up @@ -81,6 +84,10 @@ export default class LocalScheme {
}

// But logout locally regardless
return this._logoutLocally()
}

async _logoutLocally () {
if (this.options.tokenRequired) {
this._clearToken()
}
Expand Down

0 comments on commit b6cfad4

Please sign in to comment.