Skip to content

Commit a6a0554

Browse files
authored
fix(auth, android): fix an error casing that wasn't consistent accross platforms (#18056)
1 parent 3ffa411 commit a6a0554

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/utils/exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ String? _getCustomCode(Map? additionalData, String? message) {
154154
for (final recognizedCode in listOfRecognizedCode) {
155155
if (additionalData?['message'] == recognizedCode ||
156156
(message?.contains(recognizedCode) ?? false)) {
157-
return recognizedCode;
157+
return recognizedCode.toLowerCase().replaceAll('_', '-');
158158
}
159159
}
160160

packages/firebase_auth/firebase_auth_platform_interface/test/method_channel_tests/utils_tests/exception_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void main() {
4444
() => convertPlatformException(platformException, StackTrace.empty),
4545
throwsA(
4646
isA<FirebaseAuthException>()
47-
.having((e) => e.code, 'code', 'BLOCKING_FUNCTION_ERROR_RESPONSE')
47+
.having((e) => e.code, 'code', 'blocking-function-error-response')
4848
.having((e) => e.message, 'message',
4949
'{"error":{"details":"The user is not allowed to log in","message":"","status":"PERMISSION_DENIED"}}'),
5050
),

0 commit comments

Comments
 (0)