@@ -79,6 +79,12 @@ export const auth = defineAuth({
7979 loginWith: {
8080 email: true ,
8181 },
82+ userAttributes: {
83+ locale: {
84+ required: false ,
85+ mutable: true ,
86+ },
87+ },
8288 groups: [" admin" ],
8389});
8490```
@@ -99,6 +105,7 @@ import {
99105 getSecret ,
100106} from " @aws-amplify/seed" ;
101107import { Amplify } from " aws-amplify" ;
108+ // @ts-expect-error this file will not exist until sandbox is created
102109import outputs from " ../../amplify_outputs.json" ;
103110
104111Amplify .configure (outputs );
@@ -111,6 +118,9 @@ const user = await createAndSignUpUser({
111118 password: password ,
112119 signInAfterCreation: false ,
113120 signInFlow: " Password" ,
121+ userAttributes: {
122+ locale: " en" ,
123+ },
114124});
115125
116126await addToUserGroup (user , " admin" );
@@ -157,10 +167,14 @@ import {
157167import { Amplify } from " aws-amplify" ;
158168import * as auth from " aws-amplify/auth" ;
159169import * as otpauth from " otpauth" ;
170+ // @ts-expect-error this file will not exist until sandbox is created
160171import outputs from " ../../amplify_outputs.json" ;
172+
161173Amplify .configure (outputs );
162- const username = await getSecret (" username1" );
163- const password = await getSecret (" password1" );
174+
175+ const username = await getSecret (" username" );
176+ const password = await getSecret (" password" );
177+
164178const setUpTOTPAndChallenge = async (
165179 totpSetup : auth .SetUpTOTPOutput
166180): Promise <ChallengeResponse > => {
@@ -228,6 +242,7 @@ import * as auth from "aws-amplify/auth";
228242import type { Schema } from " ./../data/resource" ;
229243
230244import { generateClient } from " aws-amplify/api" ;
245+ // @ts-expect-error this file will not exist until sandbox is created
231246import outputs from " ../../amplify_outputs.json" ;
232247
233248Amplify .configure (outputs );
@@ -289,8 +304,8 @@ Now to seed your storage with a picture, you can write the following script:
289304import { getSecret , signInUser } from " @aws-amplify/seed" ;
290305import { Amplify } from " aws-amplify" ;
291306import * as auth from " aws-amplify/auth" ;
292-
293307import * as storage from " aws-amplify/storage" ;
308+ // @ts-expect-error this file will not exist until sandbox is created
294309import outputs from " ../../amplify_outputs.json" ;
295310
296311Amplify .configure (outputs );
0 commit comments