Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change password using old password on parse android

I have an android app in which user can change his/her password my problem is how i can verify old password of user using parse i have 3 edit text "old password, new password and confirm new password".

I search on parse.com but can't find any solution parse do not fetch data using get password. i am doing this

String get_confrimpass=currentuser.getpassword();



if(get_confrimpass.replaceAll("\\s", "").equals(current_pass_check))
            {           }
like image 751
hena12 Avatar asked Dec 15 '14 11:12

hena12


1 Answers

You can try logging them in using there current username and the password that they have given to you. If the loggin is successful the old password is correct. I.e

ParseUser.logInInBackground(ParseUser.getCurrentUser().getUsername(), currentPassword, new LogInCallback() {  
    public void done(ParseUser user, ParseException e) {    
        if (user != null) {      
             // Hooray! The password is correct 
        } else {      
             // The password was incorrect 
        }  
   }
});

In the example above the 'currentPassword' variable is the text that you would retreive from the 'Old Password' EditText

like image 138
JayDev Avatar answered Oct 03 '22 22:10

JayDev