+ }.bind(this);
+ req.response(this, logout_func);
+ req.error(this, logout_func);
+ req.go();
+ },
+ authenticationFailed: function() {
+ enyo.log("Authentication failed -- logging out");
+ this.expireClientAuthentication();
+ this.bubble('onAuthFailure');
+ },
+ changePassword: function(oldpassword, newpassword) {
+ var req = new enyo.Ajax({
+ url: baseURL + '/passwd',
+ method: 'POST',
+ postBody: {
+ password: oldpassword,
+ new_password: newpassword
+ }
+ });
+ req.response(this, function(inSender, inResponse) {
+ if (inResponse.status == 'success') {
+ this.bubble('onPasswordChangeSuccessful');
+ } else {
+ this.bubble('onPasswordChangeFailed');
+ }
+ });
+ req.error(this, function() {
+ this.bubble('onPasswordChangeFailed');