summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Amaury Carrade <amaury@carrade.eu> 2014-01-26 21:36:42 +0100
committerGravatar Amaury Carrade <amaury@carrade.eu> 2014-01-26 21:36:42 +0100
commit19eefd434c45791ff48c0b5a9ecc642da72b71da (patch)
treecb25cdee3073ee311f565b5ccfb376e70ff45a80
parent0a1a7816093f0593dd140e664cbd09e79c0833c3 (diff)
Correction d'un conflit de PR
Conflit avec le commit https://github.com/marienfressinaud/FreshRSS/commit/7a510af73a0ef04ce09fb7eedd98c844e7bff51c
-rw-r--r--p/scripts/main.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index bd9321202..ed3cf3779 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -643,15 +643,19 @@ function init_loginForm() {
if (data.salt1 == '' || data.nonce == '') {
alert('Invalid user!');
} else {
- var strong = window.Uint32Array && window.crypto && (typeof window.crypto.getRandomValues === 'function'),
- s = dcodeIO.bcrypt.hashSync($('#passwordPlain').val(), data.salt1),
- c = dcodeIO.bcrypt.hashSync(data.nonce + s, strong ? 4 : poormanSalt());
- $('#challenge').val(c);
- if (s == '' || c == '') {
- alert('Crypto error!');
- } else {
- success = true;
- }
+ try {
+ var strong = window.Uint32Array && window.crypto && (typeof window.crypto.getRandomValues === 'function'),
+ s = dcodeIO.bcrypt.hashSync($('#passwordPlain').val(), data.salt1),
+ c = dcodeIO.bcrypt.hashSync(data.nonce + s, strong ? 4 : poormanSalt());
+ $('#challenge').val(c);
+ if (s == '' || c == '') {
+ alert('Crypto error!');
+ } else {
+ success = true;
+ }
+ } catch (e) {
+ alert('Crypto exception! ' + e);
+ }
}
}).fail(function() {
alert('Communication error!');