services/mobileid/MobileIdentitySmsMtVerificationFlow.jsm
author Nathan Froyd <froydnj@mozilla.com>
Mon, 23 Jun 2014 15:06:48 -0400
changeset 190593 fa2c5fa0167e534937bd6ef1019853c6497b11cc
parent 187426 e3dc24f425734635f3f6d663d2339c4234027d86
child 196536 5af3884cea83e35eac396428cd9357f81ca7538b
permissions -rw-r--r--
Bug 728600 - define TARGET_XPCOM_ABI in mozilla-config.h; r=glandium

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

this.EXPORTED_SYMBOLS = ["MobileIdentitySmsMtVerificationFlow"];

const { classes: Cc, interfaces: Ci, utils: Cu } = Components;

Cu.import("resource://gre/modules/MobileIdentityCommon.jsm");
Cu.import("resource://gre/modules/MobileIdentitySmsVerificationFlow.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

this.MobileIdentitySmsMtVerificationFlow = function(aOrigin,
                                                    aMsisdn,
                                                    aIccId,
                                                    aExternal,
                                                    aMtSender,
                                                    aUI,
                                                    aClient) {

  log.debug("MobileIdentitySmsVerificationFlow " + aMsisdn + ", external: " +
            aExternal);

  MobileIdentitySmsVerificationFlow.call(this,
                                         aOrigin,
                                         aMsisdn,
                                         aIccId,
                                         null, // service ID
                                         aExternal,
                                         aMtSender,
                                         null, // moVerifier
                                         aUI,
                                         aClient,
                                         this.smsVerifyStrategy);
};

this.MobileIdentitySmsMtVerificationFlow.prototype = {

  __proto__: MobileIdentitySmsVerificationFlow.prototype,

  smsVerifyStrategy: function() {
    return this.client.smsMtVerify(this.sessionToken,
                                   this.verificationOptions.msisdn,
                                   this.verificationOptions.external);
  }
};