commit 906fcac43684222b1e86b5c6687d656a7aac498d
parent 664fe685b5403f56663e92d33ba46031ebc9d13c
Author: Sheng <webmaster0115@gmail.com>
Date: Sat, 16 Dec 2017 21:48:18 +0800
Check private key size before submission
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/static/js/main.js b/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,