Skip to content

Commit f079ae2

Browse files
author
Pooya Parsa
committed
feat: handle invalid strategy
1 parent 44a7647 commit f079ae2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/core/auth.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ export default class Auth {
3535
// Restore strategy
3636
this.$storage.syncUniversal('strategy', this.options.defaultStrategy)
3737

38+
// Set default strategy if current one is invalid
39+
if (!this.strategy) {
40+
this.$storage.setUniversal('strategy', this.options.defaultStrategy)
41+
42+
// Give up if still invalid
43+
if (!this.strategy) {
44+
return Promise.resolve()
45+
}
46+
}
47+
3848
// Call mounted for active strategy on initial load
3949
return this.mounted()
4050
}

0 commit comments

Comments
 (0)