Browse Source

Check private key size before submission

pull/4/head
Sheng 7 years ago
parent
commit
906fcac436
  1. 11
      static/js/main.js

11
static/js/main.js

@ -5,14 +5,21 @@ jQuery(function($){
$('form#connect').submit(function(event) {
event.preventDefault();
status.text('');
btn.prop('disabled', true);
var form = $(this),
url = form.attr('action'),
type = form.attr('type'),
data = new FormData(this);
var pk = data.get('privatekey');
if (pk && pk.size > 16384) {
status.text('Key size exceeds maximum value.');
return;
}
status.text('');
btn.prop('disabled', true);
$.ajax({
url: url,
type: type,

Loading…
Cancel
Save