Skip to content

Conversation

qbantek
Copy link
Contributor

@qbantek qbantek commented May 17, 2023

Refactors the AuthProvider to throw the original error instead of a generic 'Login error: invalid credentials' error when dealing with Multi-Factor users.

This allows access to the error code and resolver needed for MFA sign ins.

References:
https://firebase.google.com/docs/reference/node/firebase.auth.multifactorerror https://firebase.google.com/docs/auth/web/multi-factor#signing_users_in_with_a_second_factor

qbantek added 2 commits May 17, 2023 15:44
Refactors the AuthProvider to throw the original error instead of a
generic 'Login error: invalid credentials' error.

This provides more specific error messages to the user. Specifically, it
allows access to the error code needed for MFA sign ins.

References:
https://firebase.google.com/docs/reference/node/firebase.auth.multifactorerror
https://firebase.google.com/docs/auth/web/multi-factor#signing_users_in_with_a_second_factor
Update the AuthProvider.ts to handle multi-factor authentication while
maintaining previous behaviour for all other errors.

If the error code is 'auth/multi-factor-auth-required', it logs the
second factor challenge required and throws the error. Otherwise, it
logs the invalid credentials and throws a generic error message.
@qbantek
Copy link
Contributor Author

qbantek commented May 30, 2023

@benwinding please let me know if you need any other elements to consider merging this PR. I would be glad to write some documentation around the MFA scenario or adding an example if needed. Thanks!

@qbantek qbantek mentioned this pull request May 31, 2023
@Martijncvv
Copy link

@benwinding please let me know if you need any other elements to consider merging this PR. I would be glad to write some documentation around the MFA scenario or adding an example if needed. Thanks!

Any updates on this?
Since it's still an open PR, does this mean MFA is not working properly yet?

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

Successfully merging this pull request may close these issues.

2 participants