Skip to content

Commit aeafc35

Browse files
authored
docs(auth): add information about error codes for email/password functions (#13100)
1 parent cb7f2ff commit aeafc35

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,19 @@ class FirebaseAuth extends FirebasePluginPlatform {
221221
/// email/password accounts in the Firebase Console, under the Auth tab.
222222
/// - **weak-password**:
223223
/// - Thrown if the password is not strong enough.
224+
/// - **too-many-requests**:
225+
/// - Thrown if the user sent too many requests at the same time, for security
226+
/// the api will not allow too many attemps at the same time, user will have
227+
/// to wait for some time
228+
/// - **user-token-expired**:
229+
/// - Thrown if the user is no longer authenticated since his refresh token
230+
/// has been expired
231+
/// - **network-request-failed**:
232+
/// - Thrown if there was a network request error, for example the user don't
233+
/// don't have internet connection
234+
/// - **operation-not-allowed**:
235+
/// - Thrown if email/password accounts are not enabled. Enable
236+
/// email/password accounts in the Firebase Console, under the Auth tab.
224237
Future<UserCredential> createUserWithEmailAndPassword({
225238
required String email,
226239
required String password,
@@ -558,6 +571,24 @@ class FirebaseAuth extends FirebasePluginPlatform {
558571
/// - **wrong-password**:
559572
/// - Thrown if the password is invalid for the given email, or the account
560573
/// corresponding to the email does not have a password set.
574+
/// - **too-many-requests**:
575+
/// - Thrown if the user sent too many requests at the same time, for security
576+
/// the api will not allow too many attemps at the same time, user will have
577+
/// to wait for some time
578+
/// - **user-token-expired**:
579+
/// - Thrown if the user is no longer authenticated since his refresh token
580+
/// has been expired
581+
/// - **network-request-failed**:
582+
/// - Thrown if there was a network request error, for example the user don't
583+
/// don't have internet connection
584+
/// - **INVALID_LOGIN_CREDENTIALS** or **invalid-credential**:
585+
/// - Thrown if the password is invalid for the given email, or the account
586+
/// corresponding to the email does not have a password set.
587+
/// depending on if you are using firebase emulator or not the code is
588+
/// different
589+
/// - **operation-not-allowed**:
590+
/// - Thrown if email/password accounts are not enabled. Enable
591+
/// email/password accounts in the Firebase Console, under the Auth tab.
561592
Future<UserCredential> signInWithEmailAndPassword({
562593
required String email,
563594
required String password,

packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ abstract class FirebaseAuthPlatform extends PlatformInterface {
228228
/// email/password accounts in the Firebase Console, under the Auth tab.
229229
/// - **weak-password**:
230230
/// - Thrown if the password is not strong enough.
231+
/// - **too-many-requests**:
232+
/// - Thrown if the user sent too many requests at the same time, for security
233+
/// the api will not allow too many attemps at the same time, user will have
234+
/// to wait for some time
235+
/// - **user-token-expired**:
236+
/// - Thrown if the user is no longer authenticated since his refresh token
237+
/// has been expired
238+
/// - **network-request-failed**:
239+
/// - Thrown if there was a network request error, for example the user don't
240+
/// don't have internet connection
241+
/// - **operation-not-allowed**:
242+
/// - Thrown if email/password accounts are not enabled. Enable
243+
/// email/password accounts in the Firebase Console, under the Auth tab.
231244
Future<UserCredentialPlatform> createUserWithEmailAndPassword(
232245
String email,
233246
String password,
@@ -506,6 +519,24 @@ abstract class FirebaseAuthPlatform extends PlatformInterface {
506519
/// - **wrong-password**:
507520
/// - Thrown if the password is invalid for the given email, or the account
508521
/// corresponding to the email does not have a password set.
522+
/// - **too-many-requests**:
523+
/// - Thrown if the user sent too many requests at the same time, for security
524+
/// the api will not allow too many attemps at the same time, user will have
525+
/// to wait for some time
526+
/// - **user-token-expired**:
527+
/// - Thrown if the user is no longer authenticated since his refresh token
528+
/// has been expired
529+
/// - **network-request-failed**:
530+
/// - Thrown if there was a network request error, for example the user don't
531+
/// don't have internet connection
532+
/// - **INVALID_LOGIN_CREDENTIALS** or **invalid-credential**:
533+
/// - Thrown if the password is invalid for the given email, or the account
534+
/// corresponding to the email does not have a password set.
535+
/// depending on if you are using firebase emulator or not the code is
536+
/// different
537+
/// - **operation-not-allowed**:
538+
/// - Thrown if email/password accounts are not enabled. Enable
539+
/// email/password accounts in the Firebase Console, under the Auth tab.
509540
Future<UserCredentialPlatform> signInWithEmailAndPassword(
510541
String email,
511542
String password,

0 commit comments

Comments
 (0)