1111 //result to a property on the global.
1212 root . FxAccountClient = factory ( ) ;
1313 }
14- } ( this , function ( ) { /**
15- * almond 0.2.6 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
14+ } ( this , function ( ) {
15+ /**
16+ * almond 0.2.5 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
1617 * Available via the MIT or new BSD license.
1718 * see: http://github.com/jrburke/almond for details
1819 */
@@ -396,11 +397,6 @@ var requirejs, require, define;
396397 return req ;
397398 } ;
398399
399- /**
400- * Expose module registry for debugging and tooling
401- */
402- requirejs . _defined = defined ;
403-
404400 define = function ( name , deps , callback ) {
405401
406402 //This module may not have dependencies
@@ -1946,6 +1942,8 @@ define('client/FxAccountClient',[
19461942 * @param {String } email Email input
19471943 * @param {String } password Password input
19481944 * @param {Object } [options={}] Options
1945+ * @param {Boolean } [options.keys]
1946+ * If `true`, calls the API with `?keys=true` to get the keyFetchToken
19491947 * @param {String } [options.service]
19501948 * Opaque alphanumeric token to be included in verification links
19511949 * @param {String } [options.redirectTo]
@@ -2037,6 +2035,11 @@ define('client/FxAccountClient',[
20372035 * If `true`, calls the API with `?keys=true` to get the keyFetchToken
20382036 * @param {Boolean } [options.skipCaseError]
20392037 * If `true`, the request will skip the incorrect case error
2038+ * @param {String } [options.service]
2039+ * Service being signed into
2040+ * @param {String } [options.reason]
2041+ * Reason for sign in. Can be one of: `signin`, `password_check`,
2042+ * `password_change`, `password_reset`, `account_unlock`.
20402043 * @return {Promise } A promise that will be fulfilled with JSON `xhr.responseText` of the request
20412044 */
20422045 FxAccountClient . prototype . signIn = function ( email , password , options ) {
@@ -2051,13 +2054,21 @@ define('client/FxAccountClient',[
20512054 function ( result ) {
20522055 var endpoint = '/account/login' ;
20532056
2057+ if ( options . keys ) {
2058+ endpoint += '?keys=true' ;
2059+ }
2060+
20542061 var data = {
20552062 email : result . emailUTF8 ,
20562063 authPW : sjcl . codec . hex . fromBits ( result . authPW )
20572064 } ;
20582065
2059- if ( options . keys ) {
2060- endpoint += '?keys=true' ;
2066+ if ( options . service ) {
2067+ data . service = options . service ;
2068+ }
2069+
2070+ if ( options . reason ) {
2071+ data . reason = options . reason ;
20612072 }
20622073
20632074 return self . request . send ( endpoint , 'POST' , null , data )
@@ -2384,24 +2395,6 @@ define('client/FxAccountClient',[
23842395 } ) ;
23852396 } ;
23862397
2387- /**
2388- * Gets the collection of devices currently authenticated and syncing for the user.
2389- *
2390- * @method accountDevices
2391- * @param {String } sessionToken User session token
2392- * @return {Promise } A promise that will be fulfilled with JSON `xhr.responseText` of the request
2393- */
2394- FxAccountClient . prototype . accountDevices = function ( sessionToken ) {
2395- var self = this ;
2396-
2397- required ( sessionToken , 'sessionToken' ) ;
2398-
2399- return hawkCredentials ( sessionToken , 'sessionToken' , 2 * 32 )
2400- . then ( function ( creds ) {
2401- return self . request . send ( '/account/devices' , 'GET' , creds ) ;
2402- } ) ;
2403- } ;
2404-
24052398 /**
24062399 * This deletes the account completely. All stored data is erased.
24072400 *
@@ -2745,7 +2738,6 @@ define('client/FxAccountClient',[
27452738} ) ;
27462739
27472740
2748-
27492741 //The modules for your project will be inlined above
27502742 //this snippet. Ask almond to synchronously require the
27512743 //module value for 'main' here and return it as the
0 commit comments