diff --git a/lib/schemes/local.js b/lib/schemes/local.js index 1321aef3a..d05d882f4 100644 --- a/lib/schemes/local.js +++ b/lib/schemes/local.js @@ -73,14 +73,14 @@ export default class LocalScheme { } async logout (endpoint) { - if (!this.options.endpoints.logout) { - return + // Only connect to logout endpoint if it's configured + if (this.options.endpoints.logout) { + await this.$auth + .requestWith(this.name, endpoint, this.options.endpoints.logout) + .catch(() => { }) } - await this.$auth - .requestWith(this.name, endpoint, this.options.endpoints.logout) - .catch(() => { }) - + // But logout locally regardless if (this.options.tokenRequired) { this._clearToken() }