Skip to content
v2.275.0

AccountRecovery Enum ​

How will a user be able to recover their account?

When a user forgets their password, they can have a code sent to their verified email or verified phone to recover their account. You can choose the preferred way to send codes below. We recommend not allowing phone to be used for both password resets and multi-factor authentication (MFA).

Example ​

ts
new cognito.UserPool(this, 'UserPool', {
  // ...
  accountRecovery: cognito.AccountRecovery.EMAIL_ONLY,
})

Members ​

MemberDescription
EMAIL_AND_PHONE_WITHOUT_MFAEmail if available, otherwise phone, but don’t allow a user to reset their password via phone if they are also using it for MFA.
PHONE_WITHOUT_MFA_AND_EMAILPhone if available, otherwise email, but don’t allow a user to reset their password via phone if they are also using it for MFA.
EMAIL_ONLYEmail only.
PHONE_ONLY_WITHOUT_MFAPhone only, but don’t allow a user to reset their password via phone if they are also using it for MFA.
PHONE_AND_EMAIL(Not Recommended) Phone if available, otherwise email, and do allow a user to reset their password via phone if they are also using it for MFA.
NONENone – users will have to contact an administrator to reset their passwords.

Referenced by ​

  • UserPoolProps.accountRecoveryaccount_recoveryaccountRecoveryAccountRecoveryAccountRecovery