@websanova/vue-auth
Advanced tools
Comparing version 2.18.0-beta to 2.18.1-beta
{ | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.18.0-beta" | ||
"@websanova/vue-auth": "2.18.1-beta" | ||
}, | ||
@@ -5,0 +5,0 @@ |
{ | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.18.0-beta", | ||
"@websanova/vue-auth": "2.18.1-beta", | ||
"axios": "0.16.2", | ||
@@ -5,0 +5,0 @@ "vue-axios": "2.0.2" |
@@ -47,3 +47,3 @@ { | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.18.0-beta", | ||
"@websanova/vue-auth": "2.18.1-beta", | ||
"axios": "^0.16.2", | ||
@@ -50,0 +50,0 @@ "compression": "^1.6.2", |
# Change Log | ||
### v2.18.0-beta | ||
### v2.18.x-beta | ||
* Add ability to set callback function using `$auth.ready(callback)`. | ||
* Restore enable/disable other as `disableImpersonate` and `enableImpersonate`. | ||
### v2.17.0-beta | ||
### v2.17.x-beta | ||
@@ -9,0 +10,0 @@ * Change "other" to "impersonate" keyword (and all accompanying functions). |
@@ -218,2 +218,20 @@ # Methods | ||
### disableImpersonate | ||
* Disables impersonating user using the default token until it is re-enabled (or logged out). | ||
* This allows you to login is as "another" user but still perform requests as an admin. | ||
```javascript | ||
this.$auth.disableImpersonate(); | ||
this.$http.get('users'); // Will run as default token (admin). | ||
this.$auth.enableImpersonate(); | ||
``` | ||
### enableImpersonate | ||
* See disableImpersonate. | ||
### oauth2 | ||
@@ -220,0 +238,0 @@ |
@@ -17,3 +17,3 @@ { | ||
"version": "2.18.0-beta", | ||
"version": "2.18.1-beta", | ||
@@ -20,0 +20,0 @@ "repository": { |
@@ -486,2 +486,4 @@ var __utils = require('./lib/utils.js'), | ||
this.currentToken = null; | ||
this.options = __utils.extend(defaultOptions, [options || {}]); | ||
@@ -608,5 +610,17 @@ this.options.Vue = Vue; | ||
__bindContext.call(this, 'oauth2', data); | ||
} | ||
} | ||
Auth.prototype.enableImpersonate = function () { | ||
if (this.impersonating()) { | ||
this.currentToken = null; | ||
} | ||
}; | ||
Auth.prototype.disableImpersonate = function () { | ||
if (this.impersonating()) { | ||
this.currentToken = this.options.tokenDefaultName; | ||
} | ||
}; | ||
return Auth; | ||
}; |
@@ -6,2 +6,4 @@ var __cookie = require('./cookie.js'); | ||
function tokenName(name) { | ||
name = name || this.currentToken; | ||
if (name) { | ||
@@ -8,0 +10,0 @@ return name; |
764815
147
2428