refactors to UX

This commit is contained in:
Matias Alejo Garcia 2014-09-30 20:12:02 -03:00
commit 70d306242e
5 changed files with 41 additions and 22 deletions

View file

@ -30,11 +30,17 @@ Profile.key = function(hash) {
Profile.create = function(email, password, storage, cb) {
preconditions.checkArgument(cb);
preconditions.checkArgument(storage.setPassphrase);
preconditions.checkState(storage.hasPassphrase());
var p = new Profile({
email: email,
hash: Profile.hash(email,password),
}, storage);
p.store({}, cb);
p.store({}, function(err) {
return cb(err,p);
});
};
Profile.open = function(email, password, storage, cb) {