refactor iden #create

This commit is contained in:
Matias Alejo Garcia 2014-09-30 15:28:02 -03:00
commit 606ea0668c
10 changed files with 72 additions and 54 deletions

View file

@ -24,7 +24,18 @@ Profile.hash = function(email, password) {
};
Profile.key = function(hash) {
return 'identity::' + hash;
return 'profile::' + hash;
};
Profile.create = function(email, password, storage, cb) {
preconditions.checkArgument(cb);
var p = new Profile({
email: email,
hash: Profile.hash(email,password),
}, storage);
p.store(cb);
};
Profile.open = function(email, password, storage, cb) {