Permalink
Browse files

fix: logout locally before logging in. fixes #136. (#151)

  • Loading branch information...
pedantic-git authored and pi0 committed Apr 20, 2018
1 parent 34d539e commit b6cfad470bf337bc75e02e29edb6f273dfa78c8e
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/schemes/local.js
@@ -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
@@ -81,6 +84,10 @@ export default class LocalScheme {
}
// But logout locally regardless
return this._logoutLocally()
}
async _logoutLocally () {
if (this.options.tokenRequired) {
this._clearToken()
}

0 comments on commit b6cfad4

Please sign in to comment.