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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mozilla/fxa-js-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: vue-software/fxa-js-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 17, 2014

  1. Copy the full SHA
    469338f View commit details
  2. bug: version name

    bclark8923 committed Sep 17, 2014
    Copy the full SHA
    efc358b View commit details
Showing with 8 additions and 4 deletions.
  1. +6 −3 client/FxAccountClient.js
  2. +2 −1 client/lib/credentials.js
9 changes: 6 additions & 3 deletions client/FxAccountClient.js
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ define([
* @method signUp
* @param {String} email Email input
* @param {String} password Password input
* @param {String} name Name input
* @param {Object} [options={}] Options
* @param {String} [options.service]
* Opaque alphanumeric token to be included in verification links
@@ -64,19 +65,21 @@ define([
* set the language for the 'Accept-Language' header
* @return {Promise} A promise that will be fulfilled with JSON `xhr.responseText` of the request
*/
FxAccountClient.prototype.signUp = function (email, password, options) {
FxAccountClient.prototype.signUp = function (email, password, name, options) {
var self = this;

required(email, 'email');
required(password, 'password');
required(name, 'name');

return credentials.setup(email, password)
return credentials.setup(email, password, name)
.then(
function (result) {
var endpoint = '/account/create';
var data = {
email: result.emailUTF8,
authPW: sjcl.codec.hex.fromBits(result.authPW)
authPW: sjcl.codec.hex.fromBits(result.authPW),
name: result.name
};
var requestOpts = {};

3 changes: 2 additions & 1 deletion client/lib/credentials.js
Original file line number Diff line number Diff line change
@@ -50,13 +50,14 @@ define(['./request', 'sjcl', 'p', './hkdf', './pbkdf2'], function (Request, sjcl
* @param {String} passwordInput
* @return {Promise} A promise that will be fulfilled with `result` of generated credentials
*/
setup: function (emailInput, passwordInput) {
setup: function (emailInput, passwordInput, nameInput) {
var result = {};
var email = kwe('quickStretch', emailInput);
var password = sjcl.codec.utf8String.toBits(passwordInput);

result.emailUTF8 = emailInput;
result.passwordUTF8 = passwordInput;
result.nameUTF8 = nameInput;

return pbkdf2.derive(password, email, PBKDF2_ROUNDS, STRETCHED_PASS_LENGTH_BYTES)
.then(