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

Country dial codes is not defined when using signUpConfig and defaultCountryCode #3834

Closed
ricardoribas opened this issue Aug 12, 2019 · 6 comments
Labels
feature-request Request a new feature React Native React Native related issue

Comments

@ricardoribas
Copy link

Describe the bug
When you add the sign up config, if you put the default dial code, the application will throw a runtime error due to the countryFields (not defined)

To Reproduce
Steps to reproduce the behavior:
1 - Pass signUpConfig to the withAuthenticator HOC;
2 - Add defaultCountryCode as a object property to the signUpConfig;

Expected behavior
Add default country code to the phone field;

Screenshots
Screenshot_1565627991

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

@jordanranz
Copy link
Contributor

Hey @ricardoribas,

This seems to be fixed in the latest unstable release of aws-amplify-react-native per this commit:
ef76938

Could you try installing aws-amplify-react-native@unstable and report back if that fixes your issue?

@ricardoribas
Copy link
Author

@jordanranz it solved the problem like a charm 🎉. As i am installing an unstable dependency, it will bring any unexpected errors or it will be just fine for the moment being?

@ricardoribas
Copy link
Author

Another thing that i have noticed in the aws-amplify-react-native module: If we want to make the sign in using the phone number the dial code will not be available on runtime as the AuthPiece.js is not taking that into account. I believe that the recover password will have the same issue.

Proposal

Would it make sense to you guys to add a property defaultDialCode to the AuthPiece.js renderUsernameField and all the authentication pieces will inherit this property. That is, signUp, signIn, recoverPassword (and so on...) will consume from this property in order to render the country code in the UI. What do you think?

@jordanranz
Copy link
Contributor

@ricardoribas, good to hear the fix worked! That version should be released fairly soon so it should be ok for the time being.

At first glance I think that is a good proposal. I think we should do a deep dive to understand if we can pass the dial code around in an object with the phone number. I can mark this under our UI component milestone to evaluate this for one of the phases of our release.

@jordanranz jordanranz added the feature-request Request a new feature label Aug 15, 2019
@jordanranz jordanranz added this to the UI Components Refactor milestone Aug 15, 2019
@ericclemmons
Copy link
Contributor

Closing as the bug has been fixed a while back.

As for the feature request, https://github.com/aws-amplify/amplify-js/discussions is the best place to have this conversation & vote with the community.

@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 Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature React Native React Native related issue
Projects
None yet
Development

No branches or pull requests

3 participants