Skip to content

Commit aa5f29d

Browse files
glennjacobspi0
authored andcommitted
fix(local): prevent loggedIn being incorrectly set to true (#346)
1 parent 0f32bb5 commit aa5f29d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/schemes/local.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ export default class LocalScheme {
7171
}
7272

7373
async fetchUser (endpoint) {
74+
// Token is required but not available
75+
if (this.options.tokenRequired && !this.$auth.getToken(this.name)) {
76+
return
77+
}
78+
7479
// User endpoint is disabled.
7580
if (!this.options.endpoints.user) {
7681
this.$auth.setUser({})
7782
return
7883
}
7984

80-
// Token is required but not available
81-
if (this.options.tokenRequired && !this.$auth.getToken(this.name)) {
82-
return
83-
}
84-
8585
// Try to fetch user and then set
8686
const user = await this.$auth.requestWith(
8787
this.name,

0 commit comments

Comments
 (0)