Generate and submit registrationId, fixes #25
If we're expecting to get registrationIds from others, it's only fair that we also supply our own.
This commit is contained in:
parent
5752a772d1
commit
e3b00e08f3
2 changed files with 7 additions and 4 deletions
|
@ -41,6 +41,8 @@ var single_device = false;
|
|||
var signaling_key = window.crypto.getRandomBytes(32 + 20);
|
||||
var password = btoa(getString(window.crypto.getRandomBytes(16)));
|
||||
password = password.substring(0, password.length - 2);
|
||||
var registrationId = new Uint16Array(window.crypto.getRandomBytes(2))[0];
|
||||
registrationId = registrationId & 0x3fff;
|
||||
|
||||
$('#init-go-single-client').click(function() {
|
||||
if (numberMatches()) {
|
||||
|
@ -73,7 +75,7 @@ $('#init-go').click(function() {
|
|||
$('#verify4done').html('');
|
||||
$('#verify').show();
|
||||
|
||||
API.confirmCode($('#code').val(), number, password, signaling_key, single_device,
|
||||
API.confirmCode($('#code').val(), number, password, signaling_key, registrationId, single_device,
|
||||
function(response) {
|
||||
if (single_device)
|
||||
response = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue