-
Notifications
You must be signed in to change notification settings - Fork 604
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
Fix:Failure of log-out button #790
Conversation
@tarun0 Please review when you get time :) |
|
@@ -5,6 +5,7 @@ | |||
|
|||
package com.mifos.mifosxdroid.core; | |||
|
|||
|
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.
What I meant by unnecessary blank lines were these - added by you and not those which Android Studio automatically inserts to distinguish imports from different packages. Please keep the blank lines between the imports as they were.
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.
done!
@@ -67,6 +65,7 @@ protected void onCreate(Bundle savedInstanceState) { | |||
//enabling passCodeListener only when user has already setup PassCode | |||
passCodeView.setPassCodeListener(this); | |||
} | |||
|
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.
Remove all the changes in this file except the finish()
statement.
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.
done!
You may find a tutorial for I'd recommend squashing the commits (even if there is just single commit) once the conversation has started on any PR because amending the commit will lead to deletion of the comments on the PR. |
@tarun0 i hope, it satisfies every requirement.I got stuck in some git error. I was not able to push my changes.If anything else is required,i would make the necessary changes.Thanks |
f54a044
to
0e8adcf
Compare
@tarun0 After exploring a lot with git rebase -i HEAD~X ,i hope i have finally squashed all commits into one. Don't know why i was not able to push though. I had to use git push -f. Thanks for your patience. |
7be3239
to
f9c0dae
Compare
} else { | ||
counter++; | ||
passCodeView.clearPasscodeField(); | ||
Toaster.show(clRootview, R.string.incorrect_passcode); | ||
} | ||
} | ||
|
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.
...or this one?
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.
I removed the blanked line as well. Would take care of it from now onwards.Sorry for the mistake
@@ -67,6 +67,7 @@ protected void onCreate(Bundle savedInstanceState) { | |||
//enabling passCodeListener only when user has already setup PassCode | |||
passCodeView.setPassCodeListener(this); | |||
} | |||
|
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.
Any specific purpose of this blank line?
} else { | ||
counter++; | ||
passCodeView.clearPasscodeField(); | ||
Toaster.show(clRootview, R.string.incorrect_passcode); | ||
} | ||
} | ||
|
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.
You haven't added the screenshot/GIF of the changes yet... Add it so that the reviewers (or other org members) don't have to build the app from your repo to observe the changes.
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.
Done. I am sorry for carelessness.I will be cautious from next time.
builder.setMessage(R.string.logout_message) | ||
.setPositiveButton(R.string.action_yes, new DialogInterface.OnClickListener() { | ||
public void onClick(DialogInterface dialog, int id) { | ||
PrefManager.clearToken(); |
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.
Remove all the sharedpreferences here instead of using clearToken()
method.
When one logs out, the application should clear all the saved 'SharedPreference values'. clearToken()
will only save a blank passcode value and all the remaining sharedpreferences will remain intact. You can save the Instance Domain
to make it convenient for the other users to login but it is already handled in LoginActivity
.
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.
@tarun0 I thought of clearing all the shared preferences at first but then I realized that if a user logs out and the logs in again his identity is lost and he will be a new user to the application making him to set the 4-digit passcode on subsequent logins.I will clear all the preferences for now and would start working on the problem of preventing the reset of password. I have already created an issue for that in mifos mobile as well.
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.
if a user logs out and the logs in again his identity is lost and he will be a new user to the application making him to set the 4-digit passcode on subsequent logins
Isn't it exactly how it should be? Why do you think passcode should be retained after logout?
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.
@tarun0 Let's take an example of Paytm,The user creates a 4 digit PIN which is asked before any operation involving banking.The 4 digit passcode can be used instead of a longer PIN to ensure authenticity. Once the user logs-out the application(does not mean he wont use the app again,so why need to reset the password ) the password is still saved since the user is expected to use the app again.That's my opinion.If you feel this is irrelavent i would amend the code.
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.
Your point is not irrelevant or wrong. However, you are mistaking the passcode used in the Mifos App with the PIN used in banking apps.
-
While the PIN is an added security measure in the baking apps, the passcode in Mifos is a tad inclined towards convenience as compared to security. It provides a way for the user to log into the app with a 4 digit passcode saving him from entering username and password every time he opens the app. Our intention to add such a feature is that unauthorized user (who has physical access to the phone) shouldn't use be allowed to use the app when the authenticated user has already exited it (in the future versions, it's supposed to evolve into a feature that would ask for passcode every time before the user performs any writable action, e.g. apply for a loan).
-
The PIN used in banking apps is stored on the server side to verify the authenticity whereas, in our app, the Passcode is saved in SharedPreference (hashed form) only and the verification is done locally, without any kind of intervention from the server.
Still, there's some flaw in your proposition. If the user logs in from device 1 and saves the passcode and then logs out, assuming that the passcode still refers that particular user, what will happen if he logs in from device 2? How will device 1 get information that a new passcode has been generated on some other device? The solution to this intervention of the server.
Your proposition was something in the pipeline but it might affect offline functionality and would add to more network calls. As I'm not the right person to confirm or reject any possibility whether this feature will be added, I can only tell you that it's not present currently.
I hope it provides some clarification. :)
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.
@tarun0 Alright,I understood the functionality of the passcode now. Moreover retaining the passcode would be consistent only if the application is hosted on a universally available database on cloud. I have made the changes by clearing the preferences on logout.Thanks
builder.setMessage(R.string.logout_message) | ||
.setPositiveButton(R.string.action_yes, new DialogInterface.OnClickListener() { | ||
public void onClick(DialogInterface dialog, int id) { | ||
PrefManager.clearToken(); |
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.
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.
@tarun0 I would check this in some other device as well and post the update.
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.
@tarun0 I have checked the application on Android 6.0.1,API 23 and on Android 5.0.2 API 21 and I did not find the white text problem.
b40f956
to
aa472c5
Compare
@tarun0 Could you please review and suggest any improvements if any so it could be merged.Thanks |
@AkshGautam Good work, Can you please make little changes, We already have Material Dialog Please make changes in PR and use this https://github.com/openMF/android-client/blob/master/mifosng-android/src/main/java/com/mifos/mifosxdroid/core/MaterialDialog.java |
@therajanmaurya sure! I would make the changes. |
87b815b
to
3bf781d
Compare
@therajanmaurya @tarun0 done the changes by adding material dialog as well. |
@therajanmaurya Issue Number #787 |
Contributor made requested changes, No need to wait.
Log Out Button is working fine!