check if there is not profile, to redir

This commit is contained in:
Matias Alejo Garcia 2014-10-11 08:43:51 -03:00
commit b03a3f1391
9 changed files with 52 additions and 28 deletions

View file

@ -43,6 +43,13 @@ Profile.create = function(email, password, storage, cb) {
});
};
Profile.any = function(storage, cb) {
storage.getFirst(Profile.key(''), function(err, val) {
return cb(val ? true : false);
});
};
Profile.open = function(email, password, storage, cb) {
preconditions.checkArgument(cb);
preconditions.checkState(storage.hasPassphrase());