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

Clarify EmailId #22

Open
alankley opened this issue Feb 14, 2021 · 1 comment
Open

Clarify EmailId #22

alankley opened this issue Feb 14, 2021 · 1 comment

Comments

@alankley
Copy link
Collaborator

alankley commented Feb 14, 2021

What is a valid email id?
I'm unable to use valid dynamic gmail addresses with special characters (+, .)

We should distinguish "correct" email address (what user provided) and correctly FORMED email addresses.
If incorrectly formed we should display what format we expect as an error message

I recommend we refer to the email always as an email. I don't recommend we use it as an ID to identify a user in the database. The user might want to change their email. We CAN allow them to use it to login. Optionally we can offer a username. A username can be used in the UI to identify a user on the map, etc.

The ID of the user item in the database can be duplicated inside the User item and used as a unique key/id. It can serve as the key in Maps for convenient retrieval.

@alankley
Copy link
Collaborator Author

alankley commented Feb 18, 2021

On Android, there is the following Pattern:
public static final Pattern EMAIL_ADDRESS
= Pattern.compile(
"[a-zA-Z0-9\+\.\_\%\-\+]{1,256}" +
"\@" +
"[a-zA-Z0-9][a-zA-Z0-9\-]{0,64}" +
"(" +
"\." +
"[a-zA-Z0-9][a-zA-Z0-9\-]{0,25}" +
")+"
);

Valid Email on Android can be checked with:
android.util.Patterns.EMAIL_ADDRESS.matcher(targetEmail).matches()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant