@@ -307,7 +307,7 @@ export interface UserInvitationConfig {
307
307
* The different ways in which a user pool's MFA enforcement can be configured.
308
308
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa.html
309
309
*/
310
- export enum MfaEnforcement {
310
+ export enum Mfa {
311
311
/** Users are not required to use MFA for sign in, and cannot configure one. */
312
312
OFF = 'OFF' ,
313
313
/** Users are not required to use MFA for sign in, but can configure one if they so choose to. */
@@ -320,7 +320,7 @@ export enum MfaEnforcement {
320
320
* The different ways in which a user pool can obtain their MFA token for sign in.
321
321
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa.html
322
322
*/
323
- export interface MfaTypes {
323
+ export interface MfaSecondFactor {
324
324
/**
325
325
* The MFA token is sent to the user via SMS to their verified phone numbers
326
326
* @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-mfa-sms-text-message.html
@@ -468,17 +468,17 @@ export interface UserPoolProps {
468
468
/**
469
469
* Configure on whether users of this user pool can or are required use MFA to sign in.
470
470
*
471
- * @default MfaEnforcement .OFF
471
+ * @default Mfa .OFF
472
472
*/
473
- readonly mfaEnforcement ?: MfaEnforcement ;
473
+ readonly mfa ?: Mfa ;
474
474
475
475
/**
476
476
* Configure the MFA types that users can use in this user pool. Ignored if `mfaEnforcement` is set to `OFF`.
477
477
*
478
478
* @default - { sms: true, oneTimePassword: false }, if `mfaEnforcement` is set to `OPTIONAL` or `REQUIRED`.
479
479
* { sms: false, oneTimePassword: false }, otherwise
480
480
*/
481
- readonly mfaTypes ?: MfaTypes ;
481
+ readonly mfaSecondFactor ?: MfaSecondFactor ;
482
482
483
483
/**
484
484
* Password policy for this user pool.
@@ -629,7 +629,7 @@ export class UserPool extends Resource implements IUserPool {
629
629
emailVerificationSubject,
630
630
smsVerificationMessage,
631
631
verificationMessageTemplate,
632
- mfaConfiguration : props . mfaEnforcement ,
632
+ mfaConfiguration : props . mfa ,
633
633
enabledMfas : this . mfaConfiguration ( props ) ,
634
634
policies : passwordPolicy !== undefined ? { passwordPolicy } : undefined ,
635
635
emailConfiguration : undefinedIfNoKeys ( {
@@ -837,18 +837,18 @@ export class UserPool extends Resource implements IUserPool {
837
837
}
838
838
839
839
private mfaConfiguration ( props : UserPoolProps ) : string [ ] | undefined {
840
- if ( props . mfaEnforcement === undefined || props . mfaEnforcement === MfaEnforcement . OFF ) {
840
+ if ( props . mfa === undefined || props . mfa === Mfa . OFF ) {
841
841
// since default is OFF, treat undefined and OFF the same way
842
842
return undefined ;
843
- } else if ( props . mfaTypes === undefined &&
844
- ( props . mfaEnforcement === MfaEnforcement . OPTIONAL || props . mfaEnforcement === MfaEnforcement . REQUIRED ) ) {
843
+ } else if ( props . mfaSecondFactor === undefined &&
844
+ ( props . mfa === Mfa . OPTIONAL || props . mfa === Mfa . REQUIRED ) ) {
845
845
return [ 'SMS_MFA' ] ;
846
846
} else {
847
847
const enabledMfas = [ ] ;
848
- if ( props . mfaTypes ! . sms ) {
848
+ if ( props . mfaSecondFactor ! . sms ) {
849
849
enabledMfas . push ( 'SMS_MFA' ) ;
850
850
}
851
- if ( props . mfaTypes ! . otp ) {
851
+ if ( props . mfaSecondFactor ! . otp ) {
852
852
enabledMfas . push ( 'SOFTWARE_TOKEN_MFA' ) ;
853
853
}
854
854
return enabledMfas ;
0 commit comments