Android Firebase changing user email address error

668 Views Asked by At

When trying to let a user change his/her email address Firebase gives an error. Not an error for invalid email or password, but the default error message (the third Toast message "an error occured"). In the logcat of the application are no errors. It says "success". What could be the source for the error in Firebase?

mFirebaseRef = new Firebase(Constants.FIREBASE_URL);
                    mFirebaseRef.changeEmail(email, mail, password, new Firebase.ResultHandler() {
                        @Override
                        public void onSuccess() {
                            Toast.makeText(getActivity(), "email address is changed!", Toast.LENGTH_LONG).show();

                        }

                        @Override
                        public void onError(FirebaseError firebaseError) {
                            // error encountered
                            switch (firebaseError.getCode()) {
                                case FirebaseError.USER_DOES_NOT_EXIST:
                                    Toast.makeText(getActivity(), "unknown user", Toast.LENGTH_LONG).show();
                                    break;
                                case FirebaseError.INVALID_PASSWORD:
                                    Toast.makeText(getActivity(), "invalid password", Toast.LENGTH_LONG).show();
                                    break;
                                default:
                                    Toast.makeText(getActivity(), "an error occured", Toast.LENGTH_LONG).show();
                                    break;
                            }
                        }
                    });
0

There are 0 best solutions below