-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fix: Resolve 'Invalid Email' on login after OTP signup #13
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,8 +73,8 @@ protected void onCreate(Bundle savedInstanceState) { | |
| @Override | ||
| public void onClick(View view) { | ||
|
|
||
| String email = binding.edtEmail.getText().toString(); | ||
| String password = binding.edtPassword.getText().toString(); | ||
| String email = binding.edtEmail.getText().toString().trim().toLowerCase(); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| String password = binding.edtPassword.getText().toString().trim(); | ||
|
||
|
|
||
| if (email.isEmpty()) { | ||
| binding.edtEmail.setError(getString(R.string.enter_valid_email)); | ||
|
|
@@ -107,8 +107,8 @@ public void onComplete(@NonNull Task<AuthResult> task) { | |
| @Override | ||
| public void onClick(View v) { | ||
|
|
||
| String email = binding.edtEmail.getText().toString(); | ||
| String password = binding.edtPassword.getText().toString(); | ||
| String email = binding.edtEmail.getText().toString().trim().toLowerCase(); | ||
|
||
| String password = binding.edtPassword.getText().toString().trim(); | ||
|
||
|
|
||
| if (email.isEmpty()) { | ||
| binding.edtEmail.setError(getString(R.string.enter_valid_email)); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,10 +69,10 @@ protected void onCreate(Bundle savedInstanceState) { | |
|
|
||
| private void doValidation() { | ||
|
|
||
| String name = binding.edtName.getText().toString(); | ||
| String email = binding.edtEmail.getText().toString(); | ||
| String number = binding.edtMobile.getText().toString(); | ||
| String password = binding.edtPassword.getText().toString(); | ||
| String name = binding.edtName.getText().toString().trim(); | ||
| String email = binding.edtEmail.getText().toString().trim().toLowerCase(); | ||
|
||
| String number = binding.edtMobile.getText().toString().trim(); | ||
| String password = binding.edtPassword.getText().toString().trim(); | ||
|
||
|
|
||
| if (name.isEmpty()) { binding.edtName.setError(getString(R.string.enter_good_name)); return; } | ||
| if (email.isEmpty()) { binding.edtEmail.setError(getString(R.string.enter_valid_email)); return; } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String.toLowerCase()without an explicitLocaleuses the device default locale, which can produce incorrect results for certain locales (e.g., Turkish i/I) and break email matching. UsetoLowerCase(Locale.ROOT)(and add the corresponding import) for locale-independent normalization.