Ensures Entity.tempAuth is destroyed once the client is configured
diff --git a/lib/entity.js b/lib/entity.js
index c1929c7..ed8b1ac 100644
--- a/lib/entity.js
+++ b/lib/entity.js
@@ -90,6 +90,7 @@
var args = helpers.args(arguments)
var client = helpers.client.validate(args)
client.tempAuth = this.tempAuth
+ this.tempAuth = undefined
var callback = helpers.cb(args)
client.GET(this, function(error, usergridResponse) {
helpers.setWritable(this, ['uuid', 'name', 'type', 'created'])
@@ -102,6 +103,7 @@
var args = helpers.args(arguments)
var client = helpers.client.validate(args)
client.tempAuth = this.tempAuth
+ this.tempAuth = undefined
var callback = helpers.cb(args)
client.PUT(this, function(error, usergridResponse) {
helpers.setWritable(this, ['uuid', 'name', 'type', 'created'])
@@ -114,6 +116,7 @@
var args = helpers.args(arguments)
var client = helpers.client.validate(args)
client.tempAuth = this.tempAuth
+ this.tempAuth = undefined
var callback = helpers.cb(args)
client.DELETE(this, function(error, usergridResponse) {
callback(error, usergridResponse, this)
@@ -126,6 +129,7 @@
var args = helpers.args(arguments)
var client = helpers.client.validate(args)
client.tempAuth = this.tempAuth
+ this.tempAuth = undefined
args[0] = this
return client.connect.apply(client, args)
},
@@ -133,6 +137,7 @@
var args = helpers.args(arguments)
var client = helpers.client.validate(args)
client.tempAuth = this.tempAuth
+ this.tempAuth = undefined
args[0] = this
return client.disconnect.apply(client, args)
},
@@ -140,6 +145,7 @@
var args = helpers.args(arguments)
var client = helpers.client.validate(args)
client.tempAuth = this.tempAuth
+ this.tempAuth = undefined
args.shift()
args.splice(1, 0, this)
return client.getConnections.apply(client, args)