From 5d726b6e211c0cb56e49437926b4277def7bac5e Mon Sep 17 00:00:00 2001 From: Sebastian Di Luzio Date: Thu, 13 Feb 2020 11:40:25 +0100 Subject: [PATCH] fix issues the original PR 278 has - 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 --- lib/schemes/local.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/schemes/local.js b/lib/schemes/local.js index 38fbc515a..e5d46c705 100644 --- a/lib/schemes/local.js +++ b/lib/schemes/local.js @@ -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() }