Amplify Toolbox
    Preparing search index...
    PhoneNumberLogin:
        | true
        | {
            otpLogin?: boolean;
            verificationMessage?: (createCode: () => string) => string;
        }

    Phone number login options.

    If true, phone number login will be enabled with default settings. If settings are provided, phone number login will be enabled with the specified settings.

    Type declaration

    • true
    • {
          otpLogin?: boolean;
          verificationMessage?: (createCode: () => string) => string;
      }
      • OptionalotpLogin?: boolean

        Enable SMS OTP (one-time password) login for passwordless authentication.

        When enabled, users can sign in by receiving a one-time code via SMS instead of using a password.

        Note: Enabling passwordless login via otpLogin automatically enables the ALLOW_USER_AUTH authentication flow in your Cognito App Client

        false
        
        // Enable SMS OTP login
        defineAuth({
        loginWith: {
        phone: {
        otpLogin: true
        }
        }
        })
      • OptionalverificationMessage?: (createCode: () => string) => string

        The message template for the verification SMS sent to the user upon sign up.

        // If VerificationEmailStyle.LINK is chosen, verificationMessage will not be configured by default.

        // If VerificationEmailStyle.CODE is chosen, the default function will be as follows: (code) => The verification code to your new account is ${createCode()}