Skip to content

Commit

Permalink
feat: handle invalid strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Apr 2, 2018
1 parent 44a7647 commit f079ae2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/core/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ export default class Auth {
// Restore strategy
this.$storage.syncUniversal('strategy', this.options.defaultStrategy)

// Set default strategy if current one is invalid
if (!this.strategy) {
this.$storage.setUniversal('strategy', this.options.defaultStrategy)

// Give up if still invalid
if (!this.strategy) {
return Promise.resolve()
}
}

// Call mounted for active strategy on initial load
return this.mounted()
}
Expand Down

0 comments on commit f079ae2

Please sign in to comment.