From b6cfad470bf337bc75e02e29edb6f273dfa78c8e Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 20 Apr 2018 18:15:24 +0100 Subject: [PATCH] fix: logout locally before logging in. fixes #136. (#151) --- lib/schemes/local.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/schemes/local.js b/lib/schemes/local.js index d05d882f4..38316d313 100644 --- a/lib/schemes/local.js +++ b/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() }