kopia lustrzana https://github.com/backface/turtlestitch
change password
rodzic
e869484b8e
commit
158be149ea
19
cloud.js
19
cloud.js
|
@ -251,19 +251,34 @@ Cloud.prototype.login = function (username, password, persist, onSuccess, onErro
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Cloud.prototype.signup = function (username, password, password_repeat, email, onSuccess, onError){
|
Cloud.prototype.signup = function (username, password, passwordRepeat, email, onSuccess, onError) {
|
||||||
this.request(
|
this.request(
|
||||||
'POST',
|
'POST',
|
||||||
'/users/' + username + '?' + this.encodeDict({
|
'/users/' + username + '?' + this.encodeDict({
|
||||||
email: email,
|
email: email,
|
||||||
password: password,
|
password: password,
|
||||||
password_repeat: password_repeat
|
password_repeat: passwordRepeat
|
||||||
}),
|
}),
|
||||||
onSuccess,
|
onSuccess,
|
||||||
onError,
|
onError,
|
||||||
'signup failed');
|
'signup failed');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Cloud.prototype.changePassword = function (password, newPassword, passwordRepeat, onSuccess, onError) {
|
||||||
|
this.withCredentialsRequest(
|
||||||
|
'POST',
|
||||||
|
'/users/%username/newpassword?' + this.encodeDict({
|
||||||
|
oldpassword: password,
|
||||||
|
password_repeat: passwordRepeat,
|
||||||
|
newpassword: newPassword
|
||||||
|
}),
|
||||||
|
onSuccess,
|
||||||
|
onError,
|
||||||
|
'Could not change password'
|
||||||
|
);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
// Projects
|
// Projects
|
||||||
|
|
||||||
Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
|
Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
|
||||||
|
|
2
gui.js
2
gui.js
|
@ -5199,8 +5199,8 @@ IDE_Morph.prototype.changeCloudPassword = function () {
|
||||||
SnapCloud.changePassword(
|
SnapCloud.changePassword(
|
||||||
user.oldpassword,
|
user.oldpassword,
|
||||||
user.password,
|
user.password,
|
||||||
|
user.passwordRepeat,
|
||||||
function () {
|
function () {
|
||||||
myself.logout();
|
|
||||||
myself.showMessage('password has been changed.', 2);
|
myself.showMessage('password has been changed.', 2);
|
||||||
},
|
},
|
||||||
myself.cloudError()
|
myself.cloudError()
|
||||||
|
|
Ładowanie…
Reference in New Issue