Skip to content
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

Firebase Auth The password is invalid or the user does not have a password. #447

Closed
radi-cho opened this issue Aug 15, 2019 · 2 comments
Closed

Comments

@radi-cho
Copy link

radi-cho commented Aug 15, 2019

Description

In my app the log in and sign up functionalities work as expected. When a new user signs up it is created and available in the Firebase Console. Then when you log out and log in again with the credentials again everything works. But if you reset your password via the email link and try to log in again I got the following error:

2019-08-15 13:46:11.792 25601-30322/? I/AuthChimeraService: Error description received from server: INVALID_PASSWORD
2019-08-15 13:46:11.826 31496-1296/? I/Unity: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: The password is invalid or the user does not have a password.
       --- End of inner exception stack trace ---
       --- End of inner exception stack trace ---
    ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: The password is invalid or the user does not have a password.
       --- End of inner exception stack trace ---
    ---> (Inner Exception #0) Firebase.FirebaseException: The password is invalid or the user does not have a password.<---
    <---

I use the Unity SDK but that should not matter because the log functionality works, but breaks after the password is reset.

Reproduce

I THINK THIS IS NOT SPECIFIC TO UNITY AT ALL!

  • Sign Up the user. Implementation:
auth.CreateUserWithEmailAndPasswordAsync(EmailInputValue.text, PasswordInputValue.text).ContinueWith(task => {
            if (task.IsCanceled) {
                Info.text = "Something went wrong: Sign Up Task was canceled.";
                return;
            }
            if (task.IsFaulted) {
                Info.text = "Error! If you already own an account please log in instead. Make sure all fields are filled correctly!";
                return;
            }

            user = task.Result;
            VerifyEmail();
        });
  • Email verification implementation:
public void VerifyEmail()
    {
        user.SendEmailVerificationAsync();
        Info.text = "We have sent you a new verification message.";
    }
  • [Optional] Log Out and Log In to verify the Log in implementation works.
auth.SignInWithEmailAndPasswordAsync(EmailInputValue.text, PasswordInputValue.text).ContinueWith(task => {
            if (task.IsCanceled) {
                Info.text = "Something went wrong: Log In Task was canceled.";
                return;
            }
            if (task.IsFaulted) {
                Info.text = "Ensure stable internet connection! Make sure your email and password are correct or reset them! If you do not have account Sign Up instead!";
                Debug.Log(task.Exception);
                return;
            }

            user = task.Result;
        });
  • Log Out
auth.SignOut();
user = null;
PlayerPrefs.DeleteAll();
  • Reset user's password
auth.SendPasswordResetEmailAsync(EmailInputValue.text).ContinueWith((authTask) => {
            if (authTask.IsCompleted) {
                Info.text = "Reset email sent successfully!\nPlease follow the instructions sent to you via email!";
            }
        });
  • Set a new password via the link you received. (Meaning everything so far was successful)
  • Go back to the app and Log In with the new credentials (verified they're correct. Tested 5 times in a row)
  • Get an error FirebaseException: The password is invalid or the user does not have a password.
@radi-cho radi-cho added the new New issue. label Aug 15, 2019
@DellaBitta
Copy link
Contributor

Hi @radi-cho,

Thanks for the really detailed report! Unfortunately I couldn't reproduce this issue locally. I used the auth testapp to drive most of this testing. The only change I had to make is to hard-code a call to sendEmailVerificationAsync after a successful sign-in since it's not part of the standard app functionality.

Can you try to reproduce this with the test app in your environment? If you can reproduce it, could you also post your SDK/ Unity versions and which platform are you testing on? Thank you.

@DellaBitta DellaBitta added type: question and removed new New issue. labels Aug 16, 2019
@radi-cho
Copy link
Author

radi-cho commented Aug 17, 2019

After deeper investigation I found some weird bug in Unity with the input field value, which is stored correctly but once you navigate to the restore password page the value is moved to another instance. Anyways I think I've solved the issue. Thanks for the response and sorry fur the unnecessary report. 😃

@firebase firebase locked and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants