@websanova/vue-auth
Advanced tools
Comparing version 2.0.0-beta to 2.1.0-beta
@@ -17,3 +17,3 @@ { | ||
"version": "2.0.0-beta", | ||
"version": "2.1.0-beta", | ||
@@ -28,3 +28,3 @@ "repository": { | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.0.0-beta" | ||
"@websanova/vue-auth": "2.1.0-beta" | ||
}, | ||
@@ -31,0 +31,0 @@ |
@@ -468,2 +468,3 @@ # Vue Auth | ||
* Accepts `redirect` parameter which is passed directly to router. | ||
* Accepts `fetchUser` param which allows disabling fetching user after login. | ||
@@ -477,2 +478,3 @@ ~~~ | ||
redirect: '/account', | ||
fetchUser: true | ||
// etc... | ||
@@ -597,5 +599,6 @@ }); | ||
### loginData: `{url: 'auth/login', method: 'POST', redirect: '/'}` | ||
### loginData: `{url: 'auth/login', method: 'POST', redirect: '/', fetchUser: true}` | ||
* Default login request data and redirect. | ||
* To disable user fetching on login set the `fetchUser` to `false`. | ||
@@ -701,2 +704,3 @@ ### logoutData: `{url: 'auth/logout', method: 'POST', redirect: '/', makeRequest: false}` | ||
* The options for `router`, `http` and `auth` must be set now and will not auto bind (this is because webpack would pre load all drivers with dynamic variable). | ||
* Added `loginData.fetchUser` option to allow disabling of user fetch on login (which will also be disabled on refreshes). | ||
@@ -703,0 +707,0 @@ |
@@ -106,3 +106,3 @@ var __utils = require('./lib/utils.js'), | ||
function _check(role) { | ||
if (this.watch.data !== null) { | ||
if (this.watch.authenticated === true) { | ||
if (role) { | ||
@@ -142,3 +142,8 @@ return __utils.compare(role, this.watch.data[this.options.rolesVar]); | ||
__duckPunch.call(this, 'fetch', data); | ||
if (this.watch.authenticated !== true && !this.options.loginData.fetchUser) { | ||
_fetchProcess.call(this, {}, data); | ||
} | ||
else { | ||
__duckPunch.call(this, 'fetch', data); | ||
} | ||
} | ||
@@ -220,3 +225,3 @@ | ||
this.authenticated = false; | ||
this.watch.authenticated = false; | ||
this.watch.data = null; | ||
@@ -340,3 +345,3 @@ | ||
registerData: {url: 'auth/register', method: 'POST', redirect: '/login'}, | ||
loginData: {url: 'auth/login', method: 'POST', redirect: '/'}, | ||
loginData: {url: 'auth/login', method: 'POST', redirect: '/', fetchUser: true}, | ||
logoutData: {url: 'auth/logout', method: 'POST', redirect: '/', makeRequest: false}, | ||
@@ -343,0 +348,0 @@ oauth1Data: {url: 'auth/login', method: 'POST'}, |
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
345573
2428
756