Skip to content

Commit

Permalink
fix(local): prevent loggedIn being incorrectly set to true (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennjacobs authored and pi0 committed May 23, 2019
1 parent 0f32bb5 commit aa5f29d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/schemes/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ export default class LocalScheme {
}

async fetchUser (endpoint) {
// Token is required but not available
if (this.options.tokenRequired && !this.$auth.getToken(this.name)) {
return
}

// User endpoint is disabled.
if (!this.options.endpoints.user) {
this.$auth.setUser({})
return
}

// Token is required but not available
if (this.options.tokenRequired && !this.$auth.getToken(this.name)) {
return
}

// Try to fetch user and then set
const user = await this.$auth.requestWith(
this.name,
Expand Down

0 comments on commit aa5f29d

Please sign in to comment.