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

invalid phone number #3868

Closed
idkjs opened this issue Aug 18, 2019 · 3 comments
Closed

invalid phone number #3868

idkjs opened this issue Aug 18, 2019 · 3 comments
Labels
bug Something isn't working React React related issues

Comments

@idkjs
Copy link

idkjs commented Aug 18, 2019

** Which Category is your question related to? **
invalid phone number input in aws-amplify-react

** What AWS Services are you utilizing? **
Aws Amplify Console auth starters here: https://github.com/aws-samples/aws-amplify-auth-starters

** Provide additional details e.g. code snippets **

I have deployed using the click to deploy button.

While trying to sign in I get this error:

error signing up:  
Object { code: "InvalidParameterException", name: "InvalidParameterException", message: "Invalid phone number format." }

I get this whether the format is +1 999-999-9999 or 999-999-999 which should work if I am reading the following correctly:

    composePhoneNumber(dial_code, phone_line_number) {
        return `${dial_code || '+1'}${phone_line_number.replace(/[-()]/g, '')}`;
    }

composePhoneNumber(dial_code, phone_line_number) {
return `${dial_code || '+1'}${phone_line_number.replace(/[-()]/g, '')}`;
}

Screen Shot 2019-08-18 at 12 35 07 PM

What is the correct format for inputting a phone number?

I have noticed that you can bypass this by leaving the phone number blank, but that does not answer the question, obviously.

Thank you.

@elorzafe elorzafe added bug Something isn't working React React related issues labels Aug 19, 2019
@dabit3
Copy link
Contributor

dabit3 commented Aug 19, 2019

@idkjs I am actually not using the composePhoneNumber method, but maybe I should be using it or something like it. Instead, you would have to add the phone number manually:

+19045555555

Or something like it. You could also add the helper method locally, something like just adding the function and processing the user input:

composePhoneNumber(dial_code, phone_line_number) {
  return `${dial_code || '+1'}${phone_line_number.replace(/[-()]/g, '')}`;
}

@idkjs
Copy link
Author

idkjs commented Aug 19, 2019

@dabit3 ok. Any docs on how to not show an unused field using withAuthenticator? In this case, lets you input the info then throws an error and doesn't do anything. Must be in options somewhere.

@idkjs idkjs closed this as completed Aug 19, 2019
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working React React related issues
Projects
None yet
Development

No branches or pull requests

3 participants