Correctly extract string data for password.
btoa expects a string argument, so when passing it the ArrayBuffer object returned by getRandomBytes(), it's converted to a string by calling .toString() on it. This always results in "[object ArrayBuffer]", effectively resulting in a completely non-random password.
This commit is contained in:
parent
cf79b41cc4
commit
3d7db4dbc3
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ $('#number').on('change', function() {//TODO
|
|||
|
||||
var single_device = false;
|
||||
var signaling_key = getRandomBytes(32 + 20);
|
||||
var password = btoa(getRandomBytes(16));
|
||||
var password = btoa(getString(getRandomBytes(16)));
|
||||
password = password.substring(0, password.length - 2);
|
||||
|
||||
$('#init-go-single-client').click(function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue