B2G/gecko/services/aitc/modules/manager.js
/* Obtain a token from Sagrada token server, given a BrowserID assertion
   * cb(err, token) will be invoked on success or failure.
   */
Obtain a token from Sagrada token server, given a BrowserID assertion
cb(err, token) will be invoked on success or failure.
Obtain a token from Sagrada token server given a BrowserID assertion cb ( err token ) will be invoked on success or failure .
function _getToken(assertion, cb) {
    let url = PREFS.get("tokenServer.url") + "/1.0/aitc/1.0";
    let client = new TokenServerClient();
    this._log.info("Obtaining token from " + url);
    let self = this;
    try {
      client.getTokenFromBrowserIDAssertion(url, assertion, function(err, tok) {
        self._gotToken(err, tok, cb);
      });
    } catch (e) {
      cb(new Error(e), null);
    }
  }
function _getToken ( assertion , cb ) { let url = PREFS . get ( "tokenServer.url" ) + "/1.0/aitc/1.0" ; let client = new TokenServerClient ( ) ; this . _log . info ( "Obtaining token from " + url ) ; let self = this ; try { client . getTokenFromBrowserIDAssertion ( url , assertion , function ( err , tok ) { self . _gotToken ( err , tok , cb ) ; } ) ; } catch ( e ) { cb ( new Error ( e ) , null ) ; } }
Obtain a token from Sagrada token server, given a BrowserID assertion
 cb(err, token) will be invoked on success or failure.
Obtain a token from Sagrada token server given a BrowserID assertion cb ( err token ) will be invoked on success or failure .