Skip to content

Commit 857cf6a

Browse files
committed
minor nits
1 parent baed20b commit 857cf6a

File tree

1 file changed

+7
-6
lines changed
  • src/pages/[platform]/deploy-and-host/sandbox-environments/seed

1 file changed

+7
-6
lines changed

src/pages/[platform]/deploy-and-host/sandbox-environments/seed/index.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ This will create a user with the username and password you provided and add them
137137

138138
The `getSecret` function will fetch the secret you created using `npx ampx sandbox secret set`. This allows you to avoid hardcoding credentials in your code. Alternatively, the username and password can be set directly as a `string` in the `createAndSignUpUser` function, but we highly recommend using `getSecret` to avoid exposing sensitive information in your repository.
139139

140+
### Multi-Factor Authentication (MFA)
141+
142+
Amplify seed supports multiple types of MFA including TOTP (Time-based One-Time Password), Email, and SMS. Below are examples of how to implement MFA in your seed script.
143+
140144
### Auth with TOTP MFA
141145

142146
For example, if you would like to seed your auth with a user with TOTP MFA enabled, lets start by configuring the auth resource:
@@ -288,13 +292,10 @@ auth.signOut();
288292

289293
This will create a user with the username and password with Email MFA enabled. The user will then be signed in and prompted for the MFA code in the command line.
290294

295+
Run the seed script
296+
291297
```bash title="Terminal" showLineNumbers={false}
292298
npx ampx sandbox seed
293-
seed is running...
294-
✔ Please input one-time password from EMAIL for [email protected]:
295-
User [email protected] was created
296-
✔ Please input one-time password from EMAIL for [email protected]:
297-
User was signed in: true
298299
```
299300

300301
SMS MFA follows the same pattern as Email MFA, using command line prompts for verification. Just replace `mfaPreference: "EMAIL"` with `mfaPreference: "SMS"` in your configuration. The command line experience will be identical, prompting for the SMS code instead of the email code.
@@ -597,7 +598,7 @@ Auth APIs allow you to create and manage users in your sandbox environment and a
597598
The `@aws-amplify/seed` package provides these essential types:
598599

599600
- `AuthSignUp` - Type for user sign-up configuration
600-
- `AuthUser` - Type for user authentication information
601+
- `AuthUser` - Type for user sign in
601602
- `ChallengeResponse` - Type for MFA challenge responses
602603
- `StandardUserAttributes` - Type for managing user attributes during sign-up
603604
- `AuthOutputs` - Type for user sign-up output

0 commit comments

Comments
 (0)