@nuxtjs/auth
Advanced tools
Comparing version 4.4.0 to 4.5.0
@@ -5,2 +5,17 @@ # Change Log | ||
<a name="4.5.0"></a> | ||
# [4.5.0](https://github.com/nuxt-community/auth-module/compare/v4.4.0...v4.5.0) (2018-05-21) | ||
### Bug Fixes | ||
* **auth:** start watching loggedIn state after current strategy is fully mounted ([#80](https://github.com/nuxt-community/auth-module/issues/80)) ([2497cc0](https://github.com/nuxt-community/auth-module/commit/2497cc0)) | ||
* **docs:** add comma following _scheme value ([#189](https://github.com/nuxt-community/auth-module/issues/189)) ([d993e01](https://github.com/nuxt-community/auth-module/commit/d993e01)) | ||
### Features | ||
* add watchLoggedIn option to optionally disable it ([#80](https://github.com/nuxt-community/auth-module/issues/80)) ([16a7904](https://github.com/nuxt-community/auth-module/commit/16a7904)) | ||
<a name="4.4.0"></a> | ||
@@ -7,0 +22,0 @@ # [4.4.0](https://github.com/nuxt-community/auth-module/compare/v4.3.0...v4.4.0) (2018-05-18) |
@@ -25,12 +25,3 @@ import getProp from 'dotprop' | ||
init () { | ||
// Watch for loggedIn changes only in client side | ||
if (process.browser) { | ||
this.$storage.watchState('loggedIn', loggedIn => { | ||
if (!routeOption(this.ctx.route, 'auth', false)) { | ||
this.redirect(loggedIn ? 'home' : 'logout') | ||
} | ||
}) | ||
} | ||
async init () { | ||
// Restore strategy | ||
@@ -50,3 +41,12 @@ this.$storage.syncUniversal('strategy', this.options.defaultStrategy) | ||
// Call mounted for active strategy on initial load | ||
return this.mounted() | ||
await this.mounted() | ||
// Watch for loggedIn changes only in client side | ||
if (process.browser && this.options.watchLoggedIn) { | ||
this.$storage.watchState('loggedIn', loggedIn => { | ||
if (!routeOption(this.ctx.route, 'auth', false)) { | ||
this.redirect(loggedIn ? 'home' : 'logout') | ||
} | ||
}) | ||
} | ||
} | ||
@@ -53,0 +53,0 @@ |
@@ -16,2 +16,4 @@ module.exports = { | ||
watchLoggedIn: true, | ||
redirect: { | ||
@@ -18,0 +20,0 @@ login: '/login', |
{ | ||
"name": "@nuxtjs/auth", | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"description": "Authentication module for Nuxt.js", | ||
@@ -57,3 +57,3 @@ "license": "MIT", | ||
"body-parser": "^1.18.3", | ||
"bootstrap-vue": "^2.0.0-rc.10", | ||
"bootstrap-vue": "^2.0.0-rc.11", | ||
"codecov": "^3.0.2", | ||
@@ -71,3 +71,3 @@ "cookie-parser": "^1.4.3", | ||
"express-jwt": "^5.3.1", | ||
"jest": "^22.4.3", | ||
"jest": "^22.4.4", | ||
"jsdom": "^11.10.0", | ||
@@ -74,0 +74,0 @@ "nuxt-class-component": "^1.2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54030
1111