Few typos blocking registration
This commit is contained in:
parent
eb80a10ed1
commit
5cea7b6857
2 changed files with 5 additions and 11 deletions
14
js/api.js
14
js/api.js
|
@ -112,14 +112,14 @@ window.textsecure.api = function() {
|
|||
};
|
||||
|
||||
self.requestVerificationCode = function(number) {
|
||||
doAjax({
|
||||
return doAjax({
|
||||
call : 'accounts',
|
||||
httpType : 'GET',
|
||||
urlParameters : '/sms/code/' + number,
|
||||
});
|
||||
};
|
||||
|
||||
self.confirmCode = function(code, number, password,
|
||||
self.confirmCode = function(number, code, password,
|
||||
signaling_key, registrationId, single_device) {
|
||||
var call = single_device ? 'accounts' : 'devices';
|
||||
var urlPrefix = single_device ? '/code/' : '/';
|
||||
|
@ -137,23 +137,17 @@ window.textsecure.api = function() {
|
|||
});
|
||||
};
|
||||
|
||||
self.registerKeys = function(keys, success_callback, error_callback) {
|
||||
self.registerKeys = function(keys) {
|
||||
//TODO: Do this conversion somewhere else?
|
||||
var identityKey = btoa(getString(keys.keys[0].identityKey));
|
||||
for (var i = 0; i < keys.keys.length; i++)
|
||||
keys.keys[i] = {keyId: i, publicKey: btoa(getString(keys.keys[i].publicKey)), identityKey: identityKey};
|
||||
keys.lastResortKey = {keyId: keys.lastResortKey.keyId, publicKey: btoa(getString(keys.lastResortKey.publicKey)), identityKey: identityKey};
|
||||
doAjax({
|
||||
return doAjax({
|
||||
call : 'keys',
|
||||
httpType : 'PUT',
|
||||
do_auth : true,
|
||||
jsonData : keys,
|
||||
}).then(function(response) {
|
||||
if (success_callback !== undefined)
|
||||
success_callback(response);
|
||||
}).catch(function(code) {
|
||||
if (error_callback !== undefined)
|
||||
error_callback(code);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ $('#init-go').click(function() {
|
|||
$('#verify4done').html('');
|
||||
$('#verify').show();
|
||||
|
||||
textsecure.register($('#code').val(), number, single_device, function(step) {
|
||||
textsecure.register(number, $('#code').val(), single_device, function(step) {
|
||||
switch(step) {
|
||||
case 1:
|
||||
$('#verify1done').html('done');
|
||||
|
|
Loading…
Reference in a new issue