Skip to content

Commit 205d43e

Browse files
committed
chore: update configure mfa language
1 parent 49db722 commit 205d43e

File tree

1 file changed

+8
-3
lines changed
  • src/pages/[platform]/build-a-backend/auth/concepts/multi-factor-authentication

1 file changed

+8
-3
lines changed

src/pages/[platform]/build-a-backend/auth/concepts/multi-factor-authentication/index.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ In this guide we will review how you can set up MFA with each of these methods a
3535
## Configure multi-factor authentication
3636

3737
Use `defineAuth` to enable MFA for your app. The example below is setting up MFA with TOTP but not SMS as you can see that the phone number is not a required attribute.
38-
- If you plan to use SMS for MFA, then the `phoneNumber` attribute must be `true`.
39-
- If you plan to use email for MFA, then the `email` attribute must also be `true`.
38+
- If you plan to use SMS for MFA, then the `phoneNumber` attribute must be marked as required in your `userAttributes`. Note that if you have `loginWith.phone` as `true` this attribute will automatically be marked as required.
39+
- If you plan to use email for MFA, then the `email` attribute must also be `true` must be marked as required in your `userAttributes`. Note that if you have `loginWith.email` as `true` this attribute will automatically be marked as required.
4040

4141
```ts title="amplify/auth/resource.ts"
4242
import { defineAuth } from '@aws-amplify/backend';
@@ -49,8 +49,13 @@ export const auth = defineAuth({
4949
multifactor: {
5050
mode: 'OPTIONAL',
5151
totp: true,
52-
}
52+
},
5353
// highlight-end
54+
userAttributes: {
55+
phoneNumber: {
56+
required: true
57+
}
58+
}
5459
});
5560
```
5661

0 commit comments

Comments
 (0)