How to use the @aws-amplify/core.JS.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 / aws-amplify-react / src / Auth / FederatedSignIn.tsx View on Github external
// @ts-ignore
			federated.oauth_config = Object.assign(
				{},
				federated.oauth_config,
				// @ts-ignore
				oauth.awsCognito
			);
		}

		// @ts-ignore
		if (oauth.auth0) {
			// @ts-ignore
			federated.auth0 = Object.assign({}, federated.auth0, oauth.auth0);
		}

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

		const {
			google_client_id,
			facebook_app_id,
			amazon_client_id,
			oauth_config,
			auth0,
		} = federated;

		const theme = this.props.theme || AmplifyTheme;
		return (
			<div>
				<div>{this.google(google_client_id)}</div>
				<div>{this.facebook(facebook_app_id)}</div></div>
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / FederatedSignIn.jsx View on Github external
throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported');
        }

        const { oauth={} } = Auth.configure();
        // backward compatibility
        if (oauth['domain']) {
            federated.oauth_config = Object.assign({}, federated.oauth_config, oauth);
        } else if (oauth.awsCognito) {
            federated.oauth_config = Object.assign({}, federated.oauth_config, oauth.awsCognito);
        }

        if (oauth.auth0) {
            federated.auth0 = Object.assign({}, federated.auth0, oauth.auth0);
        }

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

        const { google_client_id, facebook_app_id, amazon_client_id, oauth_config, auth0 } = federated;

        const theme = this.props.theme || AmplifyTheme;
        return (
            <div>
                <div>
                {this.google(google_client_id)}
                </div>
                <div>
                {this.facebook(facebook_app_id)}
                </div>
                <div>
                {this.amazon(amazon_client_id)}
                </div>
                <div></div></div>
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / ConfirmSignIn.tsx View on Github external
Auth.verifiedContact(user).then(data => {
			if (!JS.isEmpty(data.verified)) {
				this.changeState('signedIn', user);
			} else {
				const newUser = Object.assign(user, data);
				this.changeState('verifyContact', newUser);
			}
		});
	}
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / SignIn.jsx View on Github external
.then(data => {
                if (!JS.isEmpty(data.verified)) {
                    this.changeState('signedIn', user);
                } else {
                    user = Object.assign(user, data);
                    this.changeState('verifyContact', user);
                }
            });
    }
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / TOTPSetup.jsx View on Github external
.then(data => {
                if (!JS.isEmpty(data.verified)) {
                    this.changeState('signedIn', user);
                } else {
                    const newUser = Object.assign(user, data);
                    this.changeState('verifyContact', newUser);
                }
            });
    }
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / SignIn.tsx View on Github external
.then(data => {
                if (!JS.isEmpty(data.verified)) {
                    this.changeState('signedIn', user);
                } else {
                    user = Object.assign(user, data);
                    this.changeState('verifyContact', user);
                }
            });
    }
github aws-amplify / amplify-js / packages / aws-amplify-react / src / Auth / RequireNewPassword.tsx View on Github external
Auth.verifiedContact(user).then(data => {
			if (!JS.isEmpty(data.verified)) {
				this.changeState('signedIn', user);
			} else {
				user = Object.assign(user, data);
				this.changeState('verifyContact', user);
			}
		});
	}