services/mobileid/MobileIdentitySmsMtVerificationFlow.jsm
author Carsten "Tomcat" Book <cbook@mozilla.com>
Wed, 02 Jul 2014 15:00:10 +0200
changeset 191874 f58734605afd7063b2d02715075ce9f1303c838c
parent 187466 e3dc24f425734635f3f6d663d2339c4234027d86
child 196657 5af3884cea83e35eac396428cd9357f81ca7538b
permissions -rw-r--r--
merge fx-team to mozilla-central a=merge

/* 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);
  }
};