Other features

Password Recovery

You can add a “password lost” feature by calling the API:Java
1
val email = edt_email.getText().toString();
2
MBurgerAuthTasks.requestPasswordRecovery(applicationContext,
3
new MBAuthApiForgotPasswordListener() {
4
override fun onForgotPasswordRequested() {
5
//TODO show an alert
6
}
7
8
override fun onForgotPasswordRequestedError(error: String) {
9
//TODO show an error dialog
10
}
11
}, email);
Copied!
This API will send an email to the user registered with the indicated email, and if the email is not present, it will return an error.

Password Editing

You can add a “edit password” feature in your app by calling the API:
1
val old_password = edt_old_password.getText().toString();
2
val new_password = edt_new_password.getText().toString();
3
4
MBurgerAuthTasks.changePassword(getApplicationContext(), new MBAuthApiChangePasswordListener() {
5
override fun onPasswordChanged() {
6
//TODO show an alert
7
}
8
9
override fun onPasswordChangedError(error: String) {
10
//TODO show an error dialog
11
}
12
}, old_password, new_password);
Copied!
This API will work only with an user authenticated.