Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticator - Can't make phone number optional #4794

Closed
4 tasks done
lwang-79 opened this issue Nov 30, 2023 · 2 comments · Fixed by #4801
Closed
4 tasks done

Authenticator - Can't make phone number optional #4794

lwang-79 opened this issue Nov 30, 2023 · 2 comments · Fixed by #4801
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component bug Something isn't working

Comments

@lwang-79
Copy link

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Create React App

What browsers are you seeing the problem on?

Chrome

Which region are you seeing the problem in?

No response

Please describe your bug.

When the phone_number field is set as optional in the sign-up form, if it is left empty, the form still verifies the field and displays a warning message, "Invalid phone number format."

What's the expected behaviour?

If the phone number field is optional, the form should only validate it if there are any characters input. Or empty field is acceptable when the field is optional.

Help us reproduce the bug!

Setup a basic react app, add auth category and UI component.

Code Snippet

  <Authenticator 
    formFields={{
      signUp: {
        email: {
          order:1
        },
        password: {
          order: 2
        },
        confirm_password: {
          order: 3
        },
        phone_number: {
          order: 4,
          isRequired: false,
        },
      }
    }}
  >
    <App />
  </Authenticator>

Console log output

No response

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label Nov 30, 2023
@lwang-79 lwang-79 changed the title Can't make phone number optional Authenticator - Can't make phone number optional Nov 30, 2023
@calebpollman calebpollman added the bug Something isn't working label Dec 1, 2023
@calebpollman
Copy link
Member

Hi @lwang-79, thank you for raising this. Was able to repro the issue, and will be working on a fix. A short term mitigation can be to roll back to @aws-amplify/[email protected]

@calebpollman calebpollman added Authenticator An issue or a feature-request for an Authenticator UI Component and removed pending-triage Issue is pending triage labels Dec 1, 2023
@calebpollman
Copy link
Member

Fix is now available in @aws-amplify@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants