Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(local): prevent loggedIn being incorrectly set to true when user is disabled #346

Merged
merged 1 commit into from
May 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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