Commit 906fcac4 by Sheng

Check private key size before submission

parent 664fe685
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment