Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
feat(client): Return unwrapBKey in signUp if keys=true is speci…
Browse files Browse the repository at this point in the history
…fied.

fixes #135
  • Loading branch information
Shane Tomlinson committed Dec 9, 2014
1 parent bb20b81 commit 1cd19e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/FxAccountClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ define([
}
}

return self.request.send(endpoint, 'POST', null, data, requestOpts);
return self.request.send(endpoint, 'POST', null, data, requestOpts)
.then(
function(accountData) {
if (options && options.keys) {
accountData.unwrapBKey = sjcl.codec.hex.fromBits(result.unwrapBKey);
}
return accountData;
}
);
}
);
};
Expand Down
1 change: 1 addition & 0 deletions tests/lib/signUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ define([
assert.property(res, 'uid', 'uid should be returned on signUp');
assert.property(res, 'sessionToken', 'sessionToken should be returned on signUp');
assert.property(res, 'keyFetchToken', 'keyFetchToken should be returned on signUp');
assert.property(res, 'unwrapBKey', 'unwrapBKey should be returned on signUp');
},
assert.notOk
);
Expand Down

0 comments on commit 1cd19e5

Please sign in to comment.