We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @aws-amplify/auth.Auth.confirmSignIn 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-confirm-sign-in / amplify-confirm-sign-in.tsx View on Github external
async confirm(event) {
    if (event) {
      event.preventDefault();
    }
    const mfaType =
      this.user['challengeName'] === ChallengeName.SoftwareTokenMFA ? ChallengeName.SoftwareTokenMFA : null;
    if (!Auth || typeof Auth.confirmSignIn !== 'function') {
      throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported');
    }

    try {
      await Auth.confirmSignIn(this.user, this.code, mfaType);
      this.checkContact(this.user);
    } catch (error) {
      logger.error(error);
      throw new Error(error);
    }
  }