diff --git a/lib/core/auth.js b/lib/core/auth.js index fcd5b74cf..60d4d26f6 100644 --- a/lib/core/auth.js +++ b/lib/core/auth.js @@ -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() }