Skip to content

Commit 6ec29fa

Browse files
author
renkelvin
committed
Reuse FIRAuthErrorCodeInvalidCredentials
1 parent 81daeb2 commit 6ec29fa

File tree

6 files changed

+4
-21
lines changed

6 files changed

+4
-21
lines changed

FirebaseAuth/Sources/Backend/FIRAuthBackend.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,8 @@ + (nullable NSError *)clientErrorWithServerErrorMessage:(NSString *)serverErrorM
14101410
}
14111411

14121412
if ([shortErrorMessage isEqualToString:kInvalidCredentialErrorMessage] ||
1413-
[shortErrorMessage isEqualToString:kInvalidPendingToken]) {
1413+
[shortErrorMessage isEqualToString:kInvalidPendingToken] ||
1414+
[shortErrorMessage isEqualToString:kInvalidLoginCredentials]) {
14141415
return [FIRAuthErrorUtils invalidCredentialErrorWithMessage:serverDetailErrorMessage];
14151416
}
14161417

@@ -1647,11 +1648,6 @@ + (nullable NSError *)clientErrorWithServerErrorMessage:(NSString *)serverErrorM
16471648
message:serverErrorMessage];
16481649
}
16491650

1650-
if ([shortErrorMessage isEqualToString:kInvalidLoginCredentials]) {
1651-
return [FIRAuthErrorUtils errorWithCode:FIRAuthInternalErrorCodeInvalidLoginCredentials
1652-
message:serverErrorMessage];
1653-
}
1654-
16551651
// In this case we handle an error that might be specified in the underlying errors dictionary,
16561652
// the error message in determined based on the @c reason key in the dictionary.
16571653
if (errorDictionary[kErrorsKey]) {

FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ NS_SWIFT_NAME(Auth)
402402
/** @fn signInWithEmail:password:completion:
403403
@brief Signs in using an email address and password. When [Email Enumeration
404404
Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection)
405-
is enabled, this method fails with FIRAuthErrorCodeInvalidLoginCredentials in case of an invalid
405+
is enabled, this method fails with FIRAuthErrorCodeInvalidCredentials in case of an invalid
406406
email/password.
407407
408408
@param email The user's email address.

FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,6 @@ typedef NS_ERROR_ENUM(FIRAuthErrorDomain, FIRAuthErrorCode){
458458
*/
459459
FIRAuthErrorCodeRecaptchaSDKNotLinked = 17208,
460460

461-
/** Indicates that the login credentials is invalid.
462-
*/
463-
FIRAuthErrorCodeInvalidLoginCredentials = 17213,
464-
465461
/** Indicates an error occurred while attempting to access the keychain.
466462
*/
467463
FIRAuthErrorCodeKeychainError = 17995,

FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ NS_SWIFT_NAME(User)
132132

133133
/** @fn updateEmail:completion:
134134
@brief Updates the email address for the user. On success, the cached user profile data is
135-
updated. Throws FIRAuthErrorCodeInvalidLoginCredentials error when [Email Enumeration
135+
updated. Throws FIRAuthErrorCodeInvalidCredentials error when [Email Enumeration
136136
Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection)
137137
is enabled.
138138
@remarks May fail if there is already an account with this email address that was created using

FirebaseAuth/Sources/Utilities/FIRAuthErrorUtils.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,6 @@
814814
return kFIRAuthErrorMessageInvalidReqType;
815815
case FIRAuthErrorCodeRecaptchaSDKNotLinked:
816816
return kFIRAuthErrorMessageRecaptchaSDKNotLinked;
817-
case FIRAuthErrorCodeInvalidLoginCredentials:
818-
return kFIRAuthErrorMessageInvalidLoginCredentials;
819817
}
820818
}
821819

@@ -1003,8 +1001,6 @@
10031001
return @"ERROR_INVALID_REQ_TYPE";
10041002
case FIRAuthErrorCodeRecaptchaSDKNotLinked:
10051003
return @"ERROR_RECAPTCHA_SDK_NOT_LINKED";
1006-
case FIRAuthErrorCodeInvalidLoginCredentials:
1007-
return @"ERROR_INVALID_LOGIN_CREDENTIALS";
10081004
}
10091005
}
10101006

FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,6 @@ typedef NS_ENUM(NSInteger, FIRAuthInternalErrorCode) {
497497
FIRAuthInternalErrorCodeRecaptchaNotEnabled = FIRAuthPublicErrorCodeFlag |
498498
FIRAuthErrorCodeRecaptchaNotEnabled,
499499

500-
/** Indicates that the login credentials is invalid.
501-
*/
502-
FIRAuthInternalErrorCodeInvalidLoginCredentials = FIRAuthPublicErrorCodeFlag |
503-
FIRAuthErrorCodeInvalidLoginCredentials,
504-
505500
/** Indicates that the recaptcha sdk is not linked to the app.
506501
*/
507502
FIRAuthInternalErrorCodeRecaptchaSDKNotLinked = FIRAuthPublicErrorCodeFlag |

0 commit comments

Comments
 (0)