mirror of
https://github.com/amark/gun.git
synced 2025-06-07 14:46:44 +00:00
SEA User.auth test cases done & bug fixed
This commit is contained in:
parent
b74a0268d0
commit
68f5725899
6
sea.js
6
sea.js
@ -140,7 +140,7 @@
|
|||||||
root.get(key).get(function(at, ev){
|
root.get(key).get(function(at, ev){
|
||||||
key = key.slice(4);
|
key = key.slice(4);
|
||||||
ev.off();
|
ev.off();
|
||||||
if(!at.put){ return reject({err: 'Public key does not exist!'}) }
|
if(!at.put){return}
|
||||||
// attempt to PBKDF2 extend the password with the salt. (Verifying the signature gives us the plain text salt.)
|
// attempt to PBKDF2 extend the password with the salt. (Verifying the signature gives us the plain text salt.)
|
||||||
SEA.read(at.put.salt, key).then(function(salt){
|
SEA.read(at.put.salt, key).then(function(salt){
|
||||||
return SEA.proof(pass, salt);
|
return SEA.proof(pass, salt);
|
||||||
@ -198,10 +198,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Or else we failed to log in...
|
// Or else we failed to log in...
|
||||||
|
}).catch(function(e){
|
||||||
Gun.log('Failed to sign in!');
|
Gun.log('Failed to sign in!');
|
||||||
reject({err: 'Attempt failed'});
|
reject({err: 'Attempt failed'});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// if (!found) {
|
||||||
|
// reject({err: 'Public key does not exist!'})
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
16682
test/common.js
16682
test/common.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user