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

ios signInWithEmailAndPassword throws only FirebaseAuthException #314

Open
peterfromearth opened this issue Jun 1, 2022 · 4 comments
Open

Comments

@peterfromearth
Copy link

if I use Firebase.auth.signInWithEmailAndPassword(email, password) on ios instead of getting the specific exception like FirebaseAuthInvalidCredentialsException I only get FirebaseAuthException with no message text defined.

06-01 08:58:28.796 💚 DEBUG LoginComponent.onLoginPressedlambda-0[async] - START LOGIN
2022-06-01 08:58:29.286892+0200 iosApp[16480:444487] GTMSessionFetcher invoking fetch callbacks, data {length = 206, bytes = 0x7b0a2020 22657272 6f72223a 207b0a20 ... 5d0a2020 7d0a7d0a }, error Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data={length = 206, bytes = 0x7b0a2020 22657272 6f72223a 207b0a20 ... 5d0a2020 7d0a7d0a }, data_content_type=application/json; charset=UTF-8}
06-01 08:58:29.289 💚 DEBUG LoginComponent.onLoginPressedlambda-0[async] - LOGIN EXCEPTION: class dev.gitlive.firebase.auth.FirebaseAuthException
06-01 08:58:29.308 ❤️ ERROR LoginComponent.onLoginPressedlambda-0[async] - Unknown LoginError: 

on android it works like expected

@peterfromearth
Copy link
Author

seems this is the same as #317 and is already fixed with #297

As this is an annoying bug I would appreciate a new version :)

@atabekm
Copy link

atabekm commented Jan 14, 2024

Hi @peterfromearth, facing the same issue, did you manage to find a solution?

@peterfromearth
Copy link
Author

I would say it is fixed as #297 is merged.

We explicitly look at the message of the exception and not the type of the exception

@atabekm
Copy link

atabekm commented Jan 14, 2024

We explicitly look at the message of the exception and not the type of the exception

I see, I was doing something like:

return try {
    Firebase.auth.sendPasswordResetEmail(email)
} catch (e: FirebaseAuthException) {
    throw when (e) {
        is FirebaseAuthInvalidUserException -> AuthException.InvalidUserException
        else -> AuthException.UnknownException
    }
}

And wanted to check the exact type of FirebaseAuthException, but it is not working for iOS, although fine for Android. iOS seems throws generic FirebaseAuthException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants