From 4632f53480a58a09f8769fd87a2504968db65dc1 Mon Sep 17 00:00:00 2001 From: Fernando Montero Date: Wed, 4 Jun 2025 23:58:35 +0100 Subject: [PATCH 1/2] feat: allow custom field on sign in --- .../ui/src/machines/authenticator/actors/signIn.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/machines/authenticator/actors/signIn.ts b/packages/ui/src/machines/authenticator/actors/signIn.ts index c9249c0fa3..68375ecad0 100644 --- a/packages/ui/src/machines/authenticator/actors/signIn.ts +++ b/packages/ui/src/machines/authenticator/actors/signIn.ts @@ -311,8 +311,18 @@ export function signInActor({ services }: SignInMachineOptions) { return services.handleResendSignUpCode({ username }); }, handleSignIn({ formValues, username }) { - const { password } = formValues; - return services.handleSignIn({ username, password }); + // Pass all form values, including custom fields, to the service handler + const customFields = Object.keys(formValues).reduce((acc, key) => { + if (key !== 'username' && key !== 'password') { + acc[key] = formValues[key]; + } + return acc; + }, {}); + return services.handleSignIn({ + username, + password: formValues.password, + customFields, + }); }, confirmSignIn({ formValues, step }) { const formValuesKey = getConfirmSignInFormValuesKey(step); From 784ddf058625099f7b0195fc40d94fa72c8c6c38 Mon Sep 17 00:00:00 2001 From: Fernando Montero Date: Thu, 5 Jun 2025 00:06:18 +0100 Subject: [PATCH 2/2] Create smooth-pumpkins-retire.md --- .changeset/smooth-pumpkins-retire.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/smooth-pumpkins-retire.md diff --git a/.changeset/smooth-pumpkins-retire.md b/.changeset/smooth-pumpkins-retire.md new file mode 100644 index 0000000000..73783a2b38 --- /dev/null +++ b/.changeset/smooth-pumpkins-retire.md @@ -0,0 +1,5 @@ +--- +"@aws-amplify/ui": patch +--- + +feat: allow custom field on sign in