firebase / FirebaseUI-Flutter

Apache License 2.0
91 stars 79 forks source link

🐛 Raw error message exposed on SignInScreen widget on ios Simulator #292

Closed lkpiel closed 4 months ago

lkpiel commented 4 months ago

Is there an existing issue for this?

What plugin is this bug for?

Firebase UI Auth

What platform(s) does this bug affect?

iOS

List of dependencies used.

flutter pub deps -s list
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - vector_math 2.1.4
  - web 0.3.0
  - sky_engine any
- device_info_plus 9.1.1
  - device_info_plus_platform_interface ^7.0.0
  - ffi ^2.0.1
  - file >=6.1.4 <8.0.0
  - flutter any
  - flutter_web_plugins any
  - meta ^1.8.0
  - win32 >=4.0.0 <6.0.0
  - win32_registry ^1.1.0
- expandable_text 2.3.0
  - flutter any
- expansion_tile_group 1.2.4
  - flutter any
- firebase_auth 4.16.0
  - firebase_auth_platform_interface ^7.0.9
  - firebase_auth_web ^5.8.13
  - firebase_core ^2.24.2
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- firebase_core 2.24.2
  - firebase_core_platform_interface ^5.0.0
  - firebase_core_web ^2.10.0
  - flutter any
  - meta ^1.8.0
- firebase_ui_auth 1.12.1
  - email_validator ^2.1.17
  - firebase_auth ^4.15.3
  - firebase_core ^2.24.2
  - firebase_dynamic_links ^5.4.8
  - firebase_ui_localizations ^1.10.1
  - firebase_ui_oauth ^1.4.17
  - firebase_ui_shared ^1.4.1
  - flutter any
  - flutter_localizations any
  - meta ^1.10.0
- firebase_ui_oauth_google 1.2.17
  - firebase_auth ^4.15.3
  - firebase_ui_oauth ^1.4.17
  - flutter any
  - google_sign_in ^6.2.1
- flutter_material_symbols 0.0.4
  - flutter any
- flutter_svg 2.0.9
  - flutter any
  - vector_graphics ^1.1.9+1
  - vector_graphics_codec ^1.1.9+1
  - vector_graphics_compiler ^1.1.9+1
- go_router 13.0.1
  - collection ^1.15.0
  - flutter any
  - flutter_web_plugins any
  - logging ^1.0.0
  - meta ^1.7.0
- google_sign_in 6.2.1
  - flutter any
  - google_sign_in_android ^6.1.0
  - google_sign_in_ios ^5.7.0
  - google_sign_in_platform_interface ^2.4.0
  - google_sign_in_web ^0.12.0
- http 1.1.0
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
- intl 0.18.1
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.0
- multi_select_flutter 4.1.3
  - flutter any
  - collection ^1.15.0
- provider 6.1.1
  - collection ^1.15.0
  - flutter any
  - nested ^1.0.0
- shared_preferences 2.2.2
  - flutter any
  - shared_preferences_android ^2.1.0
  - shared_preferences_foundation ^2.2.0
  - shared_preferences_linux ^2.2.0
  - shared_preferences_platform_interface ^2.3.0
  - shared_preferences_web ^2.1.0
  - shared_preferences_windows ^2.2.0
- weekday_selector 1.1.0
  - flutter any

dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.6.1
  - matcher 0.12.16
  - path 1.8.3
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.1
  - vector_math 2.1.4
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - source_span 1.10.0
  - stream_channel 2.1.2
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - web 0.3.0
- flutter_lints 2.0.3
  - lints ^2.0.0

transitive dependencies:
- _flutterfire_internals 1.3.16
  - collection ^1.0.0
  - firebase_core ^2.24.2
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- args 2.4.2
- async 2.11.0
  - collection ^1.15.0
  - meta ^1.1.7
- boolean_selector 2.1.1
  - source_span ^1.8.0
  - string_scanner ^1.1.0
- characters 1.3.0
- clock 1.1.1
- collection 1.18.0
- crypto 3.0.3
  - typed_data ^1.3.0
- desktop_webview_auth 0.0.14
  - crypto ^3.0.3
  - flutter any
  - http ^1.0.0
  - flutter_web_plugins any
  - plugin_platform_interface ^2.1.4
- device_info_plus_platform_interface 7.0.0
  - flutter any
  - meta ^1.3.0
  - plugin_platform_interface ^2.0.0
- email_validator 2.1.17
- fake_async 1.3.1
  - clock ^1.1.0
  - collection ^1.15.0
- ffi 2.1.0
- file 7.0.0
  - meta ^1.9.1
  - path ^1.8.3
- firebase_auth_platform_interface 7.0.9
  - _flutterfire_internals ^1.3.16
  - collection ^1.16.0
  - firebase_core ^2.24.2
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.8.13
  - firebase_auth_platform_interface ^7.0.9
  - firebase_core ^2.24.2
  - firebase_core_web ^2.10.0
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - js ^0.6.3
  - meta ^1.8.0
- firebase_core_platform_interface 5.0.0
  - collection ^1.0.0
  - flutter any
  - flutter_test any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_core_web 2.10.0
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - meta ^1.8.0
- firebase_dynamic_links 5.4.8
  - firebase_core ^2.24.2
  - firebase_core_platform_interface ^5.0.0
  - firebase_dynamic_links_platform_interface ^0.2.6+16
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_dynamic_links_platform_interface 0.2.6+16
  - _flutterfire_internals ^1.3.16
  - firebase_core ^2.24.2
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_localizations 1.10.1
  - flutter any
  - flutter_localizations any
  - path ^1.8.3
- firebase_ui_oauth 1.4.17
  - desktop_webview_auth ^0.0.14
  - firebase_auth ^4.15.3
  - firebase_ui_auth ^1.12.1
  - firebase_ui_shared ^1.4.1
  - flutter_svg ^2.0.9
  - flutter any
- firebase_ui_shared 1.4.1
  - flutter any
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.18.1
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - path 1.8.3
  - vector_math 2.1.4
  - web 0.3.0
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.5.0
  - meta 1.10.0
  - vector_math 2.1.4
  - web 0.3.0
- google_identity_services_web 0.2.2
  - js ^0.6.4
  - meta ^1.3.0
- google_sign_in_android 6.1.21
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_ios 5.7.3
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_platform_interface 2.4.5
  - flutter any
  - plugin_platform_interface ^2.1.7
- google_sign_in_web 0.12.2+1
  - flutter any
  - flutter_web_plugins any
  - google_identity_services_web ^0.2.2
  - google_sign_in_platform_interface ^2.4.0
  - http >=0.13.0 <2.0.0
  - js ^0.6.3
- http_parser 4.0.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0
  - typed_data ^1.3.0
- js 0.6.7
  - meta ^1.7.0
- lints 2.1.1
- logging 1.2.0
- matcher 0.12.16
  - async ^2.10.0
  - meta ^1.8.0
  - stack_trace ^1.10.0
  - term_glyph ^1.2.0
  - test_api >=0.5.0 <0.7.0
- material_color_utilities 0.5.0
  - collection ^1.15.0
- meta 1.10.0
- nested 1.0.0
  - flutter any
- path 1.8.3
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- path_provider_linux 2.2.1
  - ffi >=1.1.2 <3.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.1.0
  - xdg_directories >=0.2.0 <2.0.0
- path_provider_platform_interface 2.1.2
  - flutter any
  - platform ^3.0.0
  - plugin_platform_interface ^2.1.7
- path_provider_windows 2.2.1
  - ffi ^2.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.1.0
  - win32 >=2.1.0 <6.0.0
- petitparser 5.4.0
  - meta ^1.9.0
- platform 3.1.4
- plugin_platform_interface 2.1.8
  - meta ^1.3.0
- shared_preferences_android 2.2.1
  - flutter any
  - shared_preferences_platform_interface ^2.3.0
- shared_preferences_foundation 2.3.5
  - flutter any
  - shared_preferences_platform_interface ^2.3.0
- shared_preferences_linux 2.3.2
  - file >=6.0.0 <8.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_linux ^2.0.0
  - path_provider_platform_interface ^2.0.0
  - shared_preferences_platform_interface ^2.3.0
- shared_preferences_platform_interface 2.3.2
  - flutter any
  - plugin_platform_interface ^2.1.7
- shared_preferences_web 2.2.1
  - flutter any
  - flutter_web_plugins any
  - shared_preferences_platform_interface ^2.3.0
- shared_preferences_windows 2.3.2
  - file >=6.0.0 <8.0.0
  - flutter any
  - path ^1.8.0
  - path_provider_platform_interface ^2.0.0
  - path_provider_windows ^2.0.0
  - shared_preferences_platform_interface ^2.3.0
- sky_engine 0.0.99
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- stack_trace 1.11.1
  - path ^1.8.0
- stream_channel 2.1.2
  - async ^2.5.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- term_glyph 1.2.1
- test_api 0.6.1
  - async ^2.5.0
  - boolean_selector ^2.1.0
  - collection ^1.15.0
  - meta ^1.3.0
  - source_span ^1.8.0
  - stack_trace ^1.10.0
  - stream_channel ^2.1.0
  - string_scanner ^1.1.0
  - term_glyph ^1.2.0
- typed_data 1.3.2
  - collection ^1.15.0
- vector_graphics 1.1.9+2
  - flutter any
  - vector_graphics_codec 1.1.9+2
- vector_graphics_codec 1.1.9+2
- vector_graphics_compiler 1.1.9+2
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.9+2
  - path ^1.8.0
- vector_math 2.1.4
- web 0.3.0
- win32 5.1.1
  - ffi ^2.1.0
- win32_registry 1.1.2
  - ffi ^2.1.0
  - win32 ^5.0.7
- xdg_directories 1.0.4
  - meta ^1.3.0
  - path ^1.8.0
- xml 6.3.0
  - collection ^1.17.0
  - meta ^1.9.0
  - petitparser ^5.4.0

Steps to reproduce

Flutter app that uses the SignInScreen component from flutter_ui_auth acts differently on ios and Android simulators. Raw error messages are shown on the ios simulator when something goes wrong (entering wrong password for example). When the same app is run on an Android emulator it shows the handled version of it: "The supplied auth credential is incorrect, malformed or has expired".

Expected Behavior

The default behaviour regarding error handling is the same on both platforms (ios and Android) in case something goes wrong on SignInScreen component

Actual Behavior

On ios simulator the raw error messages are exposed to the user when using SignInScreen component. The errors are formatted when the same app is ran on Android emulator.

Additional Information

This is the ios device error I am getting:

image

Full error message:

Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x600000c846f0 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={NSUnderlyingError=0x600000ca9230 {Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data={length = 224, bytes = 0x7b0a2020 22657272 6f72223a 207b0a20 ... 5d0a2020 7d0a7d0a }, data_content_type=application/json; charset=UTF-8}}, FIRAuthErrorUserInfoDeserializedResponseKey={
    code = 400;
    errors =     (
        {
            domain = global;
            message = "INVALID_LOGIN_CREDENTIALS";
            reason = invalid;
        }
    );
    message = "INVALID_LOGIN_CREDENTIALS";
}}}}

Picture of Android emulator handling the same error:

image

In addition to the simulator, I ran the app in release mode on a physical ios device, but I still see the raw error message. I didn't see any references to it in documentation so I'd like to understand if these raw errors are only somehow exposed in development or would they appear when I would actually release the app as well ? Is there a way to handle these errors on an ios Simulator ?

danagbemava-nc commented 4 months ago

Closing this as a duplicate of https://github.com/firebase/flutterfire/issues/11903.

TLDR: The issue here is that the iOS sdk does not provide a properly formatted message so the plugin cannot parse it properly. See https://github.com/firebase/flutterfire/issues/11903#issuecomment-1822341255