How to use the @aws-amplify/auth.Auth.configure function in @aws-amplify/auth

To help you get started, we’ve selected a few @aws-amplify/auth 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-federated-buttons / amplify-federated-buttons.tsx View on Github external
componentWillLoad() {
    if (!Auth || typeof Auth.configure !== 'function') {
      throw new Error(NO_AUTH_MODULE_FOUND);
    }

    const { oauth = {} } = Auth.configure({});

    // backward compatibility
    if (oauth['domain']) {
      this.federated.oauthConfig = { ...this.federated.oauthConfig, ...oauth };
    } else if (oauth['awsCognito']) {
      this.federated.oauthConfig = { ...this.federated.oauthConfig, ...oauth['awsCognito'] };
    }

    if (oauth['auth0']) {
      this.federated.auth0Config = { ...this.federated.auth0Config, ...oauth['auth0'] };
    }
  }
github aws-amplify / amplify-js / packages / amplify-ui-components / src / components / amplify-auth0-button / amplify-auth0-button.tsx View on Github external
handleLoad = () => {
    // @ts-ignore Property 'auth0' does not exist on type '{}'.
    const { oauth = {} } = Auth.configure({});
    // @ts-ignore Property 'auth0' does not exist on type '{}'.
    const { config = oauth.auth0 } = this;

    if (!config) {
      logger.debug('Auth0 is not configured');
      return;
    }

    logger.debug('auth0 configuration', config);

    if (!this._auth0) {
      this._auth0 = new window['auth0'].WebAuth(config);
    }

    this._auth0.parseHash((err, authResult) => {
      if (err) {