How to use the @aws-amplify/core.isEmpty function in @aws-amplify/core

To help you get started, we’ve selected a few @aws-amplify/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-js / packages / amplify-ui-components / src / components / amplify-confirm-sign-in / amplify-confirm-sign-in.tsx View on Github external
Auth.verifiedContact(user).then(data => {
      if (!isEmpty(data.verified)) {
        this.handleAuthStateChange(AuthState.SignedIn, user);
      } else {
        user = Object.assign(user, data);
        this.handleAuthStateChange(AuthState.VerifyContact, user);
      }
    });
  }
github aws-amplify / amplify-js / packages / amplify-ui-components / src / components / amplify-federated-buttons / amplify-federated-buttons.tsx View on Github external
render() {
    if (!Object.values(AuthState).includes(this.authState)) {
      return null;
    }

    if (isEmpty(this.federated)) {
      return null;
    }

    const { amazonClientId, auth0Config, facebookAppId, googleClientId, oauthConfig } = this.federated;

    return (
      <div>
        {googleClientId &amp;&amp; (
          <div>
            
          </div>
        )}</div>
github aws-amplify / amplify-js / packages / amplify-ui-components / src / components / amplify-require-new-password / amplify-require-new-password.tsx View on Github external
async checkContact(user) {
    if (!Auth || typeof Auth.verifiedContact !== 'function') {
      throw new Error(NO_AUTH_MODULE_FOUND);
    }
    try {
      const data = await Auth.verifiedContact(user);
      if (!isEmpty(data.verified)) {
        this.handleAuthStateChange(AuthState.SignedIn, user);
      } else {
        user = Object.assign(user, data);
        this.handleAuthStateChange(AuthState.VerifyContact, user);
      }
    } catch (error) {
      logger.error(error);
      throw new Error(error);
    }
  }
github aws-amplify / amplify-js / packages / amplify-ui-components / src / components / amplify-sign-in / amplify-sign-in.tsx View on Github external
Auth.verifiedContact(user).then(data => {
      if (!isEmpty(data.verified)) {
        this.handleAuthStateChange(AuthState.SignedIn, user);
      } else {
        user = Object.assign(user, data);
        this.handleAuthStateChange(AuthState.VerifyContact, user);
      }
    });
  }