Skip to content

Commit b6cfad4

Browse files
pedantic-gitpi0
authored andcommitted
fix: logout locally before logging in. fixes #136. (#151)
1 parent 34d539e commit b6cfad4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/schemes/local.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export default class LocalScheme {
3434
return
3535
}
3636

37+
// Ditch any leftover local tokens before attempting to log in
38+
await this._logoutLocally()
39+
3740
const result = await this.$auth.request(
3841
endpoint,
3942
this.options.endpoints.login
@@ -81,6 +84,10 @@ export default class LocalScheme {
8184
}
8285

8386
// But logout locally regardless
87+
return this._logoutLocally()
88+
}
89+
90+
async _logoutLocally () {
8491
if (this.options.tokenRequired) {
8592
this._clearToken()
8693
}

0 commit comments

Comments
 (0)