Skip to content

docs(auth): add information about error codes for email/password functions #13100

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

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ class FirebaseAuth extends FirebasePluginPlatform {
/// email/password accounts in the Firebase Console, under the Auth tab.
/// - **weak-password**:
/// - Thrown if the password is not strong enough.
/// - **too-many-requests**:
/// - Thrown if the user sent too many requests at the same time, for security
/// the api will not allow too many attemps at the same time, user will have
/// to wait for some time
/// - **user-token-expired**:
/// - Thrown if the user is no longer authenticated since his refresh token
/// has been expired
/// - **network-request-failed**:
/// - Thrown if there was a network request error, for example the user don't
/// don't have internet connection
/// - **operation-not-allowed**:
/// - Thrown if email/password accounts are not enabled. Enable
/// email/password accounts in the Firebase Console, under the Auth tab.
Future<UserCredential> createUserWithEmailAndPassword({
required String email,
required String password,
Expand Down Expand Up @@ -558,6 +571,24 @@ class FirebaseAuth extends FirebasePluginPlatform {
/// - **wrong-password**:
/// - Thrown if the password is invalid for the given email, or the account
/// corresponding to the email does not have a password set.
/// - **too-many-requests**:
/// - Thrown if the user sent too many requests at the same time, for security
/// the api will not allow too many attemps at the same time, user will have
/// to wait for some time
/// - **user-token-expired**:
/// - Thrown if the user is no longer authenticated since his refresh token
/// has been expired
/// - **network-request-failed**:
/// - Thrown if there was a network request error, for example the user don't
/// don't have internet connection
/// - **INVALID_LOGIN_CREDENTIALS** or **invalid-credential**:
/// - Thrown if the password is invalid for the given email, or the account
/// corresponding to the email does not have a password set.
/// depending on if you are using firebase emulator or not the code is
/// different
/// - **operation-not-allowed**:
/// - Thrown if email/password accounts are not enabled. Enable
/// email/password accounts in the Firebase Console, under the Auth tab.
Future<UserCredential> signInWithEmailAndPassword({
required String email,
required String password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,19 @@ abstract class FirebaseAuthPlatform extends PlatformInterface {
/// email/password accounts in the Firebase Console, under the Auth tab.
/// - **weak-password**:
/// - Thrown if the password is not strong enough.
/// - **too-many-requests**:
/// - Thrown if the user sent too many requests at the same time, for security
/// the api will not allow too many attemps at the same time, user will have
/// to wait for some time
/// - **user-token-expired**:
/// - Thrown if the user is no longer authenticated since his refresh token
/// has been expired
/// - **network-request-failed**:
/// - Thrown if there was a network request error, for example the user don't
/// don't have internet connection
/// - **operation-not-allowed**:
/// - Thrown if email/password accounts are not enabled. Enable
/// email/password accounts in the Firebase Console, under the Auth tab.
Future<UserCredentialPlatform> createUserWithEmailAndPassword(
String email,
String password,
Expand Down Expand Up @@ -506,6 +519,24 @@ abstract class FirebaseAuthPlatform extends PlatformInterface {
/// - **wrong-password**:
/// - Thrown if the password is invalid for the given email, or the account
/// corresponding to the email does not have a password set.
/// - **too-many-requests**:
/// - Thrown if the user sent too many requests at the same time, for security
/// the api will not allow too many attemps at the same time, user will have
/// to wait for some time
/// - **user-token-expired**:
/// - Thrown if the user is no longer authenticated since his refresh token
/// has been expired
/// - **network-request-failed**:
/// - Thrown if there was a network request error, for example the user don't
/// don't have internet connection
/// - **INVALID_LOGIN_CREDENTIALS** or **invalid-credential**:
/// - Thrown if the password is invalid for the given email, or the account
/// corresponding to the email does not have a password set.
/// depending on if you are using firebase emulator or not the code is
/// different
/// - **operation-not-allowed**:
/// - Thrown if email/password accounts are not enabled. Enable
/// email/password accounts in the Firebase Console, under the Auth tab.
Future<UserCredentialPlatform> signInWithEmailAndPassword(
String email,
String password,
Expand Down
Loading