-
Notifications
You must be signed in to change notification settings - Fork 0
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
UNT-T21169 - Bugfix Login Issue #2
base: development
Are you sure you want to change the base?
Conversation
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.
Please add some validation logic to mimic real bug fix scenario
4c15166
to
09e2593
Compare
} | ||
|
||
fun isValidEmail(email: String) = | ||
email.isNotEmpty() && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches() |
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.
android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()
Would already fail if email is empty, or not?
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.
yes, it fails in Pattern Matcher
VALID, INVALID_EMAIL, INVALID_PASSWORD | ||
} | ||
|
||
fun isValidLogin(email: String, password: String): ValidLogin { |
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.
Function name should have meaningful name
Are we authenticating the login?
As per my point of view, we are validating the login credential feilds.
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.
okay i have changed the name accordingly
a8c168b
to
90a91f7
Compare
} | ||
|
||
fun isValidCredentials(email: String, password: String): ValidCredentials { | ||
return if (isValidEmail(email)) { |
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.
Simplify the return using guard statements
fun isValidCredentials(email: String, password: String): String {
if (!isValidEmail(email)) return ValidCredentials.INVALID_EMAIL
if (!isValidPassword(email)) return ValidCredentials.INVALID_PASSWORD
...
}
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.
okay will follow it
Fix Forgot Password Click not working Fix Login Screen Password Check Add Validator.kt to perform Validations
90a91f7
to
c236d92
Compare
UNT-T21169 - Day4 - Bugfix/Login - ForgotPassword Issue
Fix:
Add: