Skip to content

Commit

Permalink
docs(auth): add information about error codes for email/password func…
Browse files Browse the repository at this point in the history
…tions (#13100)
  • Loading branch information
Lyokone authored Jul 29, 2024
1 parent cb7f2ff commit aeafc35
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
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

0 comments on commit aeafc35

Please sign in to comment.