packages/auth/demo/public/script.js
function getIdToken(forceRefresh) {
  if (activeUser() == null) {
    alertError('No user logged in.');
    return;
  }
  if (activeUser().getIdToken) {
    activeUser().getIdToken(forceRefresh).then(alertSuccess, function() {
      log("No token");
    });
  } else {
    activeUser().getToken(forceRefresh).then(alertSuccess, function() {
      log("No token");
    });
  }
}
function getIdToken(forceRefresh) {
  if (activeUser() == null) {
    alertError('No user logged in.');
    return;
  }
  if (activeUser().getIdToken) {
    activeUser().getIdToken(forceRefresh).then(alertSuccess, function() {
      log("No token");
    });
  } else {
    activeUser().getToken(forceRefresh).then(alertSuccess, function() {
      log("No token");
    });
  }
}
function getIdToken ( forceRefresh ) { if ( activeUser ( ) == null ) { alertError ( 'No user logged in.' ) ; return ; } if ( activeUser ( ) . getIdToken ) { activeUser ( ) . getIdToken ( forceRefresh ) . then ( alertSuccess , function ( ) { log ( "No token" ) ; } ) ; } else { activeUser ( ) . getToken ( forceRefresh ) . then ( alertSuccess , function ( ) { log ( "No token" ) ; } ) ; } }
Gets or refreshes the ID token.
@param {boolean} forceRefresh Whether to force the refresh of the token
or not.
Gets or refreshes the ID token .