Change account password (clientside RPC)
This commit is contained in:
@@ -234,6 +234,12 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
common.writeLoginBlock = function (data, cb) {
|
||||
postMessage('WRITE_LOGIN_BLOCK', data, function (obj) {
|
||||
cb(obj);
|
||||
});
|
||||
};
|
||||
|
||||
// ANON RPC
|
||||
|
||||
// SFRAME: talk to anon_rpc from the iframe
|
||||
|
||||
@@ -276,6 +276,15 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
Store.writeLoginBlock = function (clientId, data, cb) {
|
||||
store.rpc.writeLoginBlock(data, function (e, res) {
|
||||
cb({
|
||||
error: e,
|
||||
data: res
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Store.initRpc = function (clientId, data, cb) {
|
||||
if (store.rpc) { return void cb(account); }
|
||||
require(['/common/pinpad.js'], function (Pinpad) {
|
||||
|
||||
@@ -23,6 +23,7 @@ define([
|
||||
UPLOAD_COMPLETE: Store.uploadComplete,
|
||||
UPLOAD_STATUS: Store.uploadStatus,
|
||||
UPLOAD_CANCEL: Store.uploadCancel,
|
||||
WRITE_LOGIN_BLOCK: Store.writeLoginBlock,
|
||||
PIN_PADS: Store.pinPads,
|
||||
UNPIN_PADS: Store.unpinPads,
|
||||
GET_DELETED_PADS: Store.getDeletedPads,
|
||||
|
||||
@@ -221,6 +221,10 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
exp.writeLoginBlock = function (data, cb) {
|
||||
cb();
|
||||
};
|
||||
|
||||
cb(e, exp);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -643,6 +643,10 @@ define([
|
||||
Cryptpad.changePadPassword(Cryptget, href, data.password, edPublic, cb);
|
||||
});
|
||||
|
||||
sframeChan.on('Q_WRITE_LOGIN_BLOCK', function (data, cb) {
|
||||
Cryptpad.writeLoginBlock(data, cb);
|
||||
});
|
||||
|
||||
if (cfg.addRpc) {
|
||||
cfg.addRpc(sframeChan, Cryptpad, Utils);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ define({
|
||||
// Get the user's pin limit, usage and plan
|
||||
'Q_PIN_GET_USAGE': true,
|
||||
|
||||
// Write/update the login block when the account password is changed
|
||||
'Q_WRITE_LOGIN_BLOCK': true,
|
||||
|
||||
// Check the pin limit to determine if we can store the pad in the drive or if we should.
|
||||
// display a warning
|
||||
'Q_GET_PIN_LIMIT_STATUS': true,
|
||||
|
||||
Reference in New Issue
Block a user