javascript/widgets/handler/common.js
function(firebaseCredential) {
    var status = false;
    var p = component.executePromiseRequest(
        /** @type {function (): !goog.Promise} */ (
            goog.bind(app.startSignInWithCredential, app)),
        [firebaseCredential],
        function(result) {
          var container = component.getContainer();
          component.dispose();
          firebaseui.auth.widget.handler.handle(
              firebaseui.auth.widget.HandlerName.CALLBACK,
              app,
              container,
              goog.Promise.resolve(result));
          status = true;
        },
        function(error) {
          if (error['name'] && error['name'] == 'cancel') {
            return;
          } else if (error &&
                     error['code'] == 'auth/credential-already-in-use') {
            // Do nothing when anonymous user is getting updated.
            // Developer should handle this in signInFailure callback.
            return;
          } else if (error &&
                     error['code'] == 'auth/email-already-in-use' &&
                     error['email'] && error['credential']) {
            // Email already in use error should trigger account linking flow.
            // Pass error to callback handler to trigger that flow.
            var container = component.getContainer();
            component.dispose();
            firebaseui.auth.widget.handler.handle(
                firebaseui.auth.widget.HandlerName.CALLBACK,
                app,
                container,
                goog.Promise.reject(error));
            return;
          }
          var errorMessage =
              firebaseui.auth.widget.handler.common.getErrorMessage(error);
          // Show error message in the info bar.
          component.showInfoBar(errorMessage);
        });
    app.registerPending(p);
    return p.then(function() {
      // Status needs to be returned.
      return status;
    }, function(error) {
      return false;
    });
  }
function(firebaseCredential) {
    var status = false;
    var p = component.executePromiseRequest(
        /** @type {function (): !goog.Promise} */ (
            goog.bind(app.startSignInWithCredential, app)),
        [firebaseCredential],
        function(result) {
          var container = component.getContainer();
          component.dispose();
          firebaseui.auth.widget.handler.handle(
              firebaseui.auth.widget.HandlerName.CALLBACK,
              app,
              container,
              goog.Promise.resolve(result));
          status = true;
        },
        function(error) {
          if (error['name'] && error['name'] == 'cancel') {
            return;
          } else if (error &&
                     error['code'] == 'auth/credential-already-in-use') {
            // Do nothing when anonymous user is getting updated.
            // Developer should handle this in signInFailure callback.
            return;
          } else if (error &&
                     error['code'] == 'auth/email-already-in-use' &&
                     error['email'] && error['credential']) {
            // Email already in use error should trigger account linking flow.
            // Pass error to callback handler to trigger that flow.
            var container = component.getContainer();
            component.dispose();
            firebaseui.auth.widget.handler.handle(
                firebaseui.auth.widget.HandlerName.CALLBACK,
                app,
                container,
                goog.Promise.reject(error));
            return;
          }
          var errorMessage =
              firebaseui.auth.widget.handler.common.getErrorMessage(error);
          // Show error message in the info bar.
          component.showInfoBar(errorMessage);
        });
    app.registerPending(p);
    return p.then(function() {
      // Status needs to be returned.
      return status;
    }, function(error) {
      return false;
    });
  }
function ( firebaseCredential ) { var status = false ; var p = component . executePromiseRequest ( /** @type {function (): !goog.Promise} */ ( goog . bind ( app . startSignInWithCredential , app ) ) , [ firebaseCredential ] , function ( result ) { var container = component . getContainer ( ) ; component . dispose ( ) ; firebaseui . auth . widget . handler . handle ( firebaseui . auth . widget . HandlerName . CALLBACK , app , container , goog . Promise . resolve ( result ) ) ; status = true ; } , function ( error ) { if ( error [ 'name' ] && error [ 'name' ] == 'cancel' ) { return ; } else if ( error && error [ 'code' ] == 'auth/credential-already-in-use' ) { // Do nothing when anonymous user is getting updated. // Developer should handle this in signInFailure callback. return ; } else if ( error && error [ 'code' ] == 'auth/email-already-in-use' && error [ 'email' ] && error [ 'credential' ] ) { // Email already in use error should trigger account linking flow. // Pass error to callback handler to trigger that flow. var container = component . getContainer ( ) ; component . dispose ( ) ; firebaseui . auth . widget . handler . handle ( firebaseui . auth . widget . HandlerName . CALLBACK , app , container , goog . Promise . reject ( error ) ) ; return ; } var errorMessage = firebaseui . auth . widget . handler . common . getErrorMessage ( error ) ; // Show error message in the info bar. component . showInfoBar ( errorMessage ) ; } ) ; app . registerPending ( p ) ; return p . then ( function ( ) { // Status needs to be returned. return status ; } , function ( error ) { return false ; } ) ; }
Sign in with a Firebase Auth credential.
@param {!firebase.auth.AuthCredential} firebaseCredential The Firebase Auth
credential.
@return {!goog.Promise<boolean>}
Sign in with a Firebase Auth credential .