firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.57k stars 3.94k forks source link

🐛 [firebase_auth] Phone auth error when verifying code #11922

Closed juleshyacinthe closed 8 months ago

juleshyacinthe commented 9 months ago

Bug report

Describe the bug When I verify a phone number through Firebase, I consistently get the error [firebase_auth/session-expired] The SMS code has expired. Please re-send the verification code to try again. on my phone and on some other people's phones. We have customers that still manage to verify their codes though. I only tested on an Android phone that has a SIM card and a phone number that I can use. Crashlytics reports the same issue on iOS.

Steps to reproduce

Steps to reproduce the behavior:

1 - Send a code through the verifyPhoneNumber:

await _auth.verifyPhoneNumber(
    phoneNumber: phoneNumber,
    timeout: const Duration(seconds: 30),
    verificationCompleted: verificationCompleted,
    verificationFailed: verificationFailed,
    codeSent: codeSent,
    codeAutoRetrievalTimeout: codeAutoRetrievalTimeout,
);

2 - Receive a code via SMS 3 - Create a credential using the code:

final firebaseAuth.AuthCredential credential = firebaseAuth.PhoneAuthProvider.credential(
        verificationId: _verificationId,
        smsCode: code,
      );
final firebaseAuth.User firebaseUser = (await firebaseAuth.FirebaseAuth.instance.signInWithCredential(credential)).user!;

According to crashlytics, the error is triggered on the signInWithCredential line.

Expected behavior

I receive a firebase user, from which I can get a token, which I use to log the user in the app.


Additional context

This started to happen in my app over last weekend. I tried downgrading the firebase plugins to an older version that didn't have this exact issue but it doesn't fix it. It doesn't look like the problem is mentioned on the Firebase Status Dashboard. The issue was noticed with these versions in my pubspec:

firebase_auth: ^4.14.0
firebase_core: ^2.21.0

It is now also happening with these versions, but wasn't happening before:

firebase_auth: 4.12.1
firebase_core: 2.21.0

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.13.9, on Pop!_OS 22.04 LTS 6.5.6-76060506-generic, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2021.2) [✓] Android Studio (version 2022.2) [✓] VS Code (version 1.84.2) [✓] Connected device (2 available) [✓] Network resources • No issues found! ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 3.1.5 Flutter SDK 3.13.9 dependencies: - add_2_calendar 3.0.1 [flutter] - animations 2.0.8 [flutter] - another_xlider 3.0.1 [flutter] - app_links 3.4.5 [flutter plugin_platform_interface flutter_web_plugins] - app_settings 5.1.1 [flutter plugin_platform_interface] - appsflyer_sdk 6.12.2 [flutter] - auto_size_text 3.0.0 [flutter] - auto_size_text_field 2.2.2 [flutter] - back_button_interceptor 7.0.0 [collection flutter] - cached_network_image 3.3.0 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - carousel_slider 4.2.1 [flutter] - collection 1.17.2 - connectivity_plus 5.0.1 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - contacts_service 0.6.3 [flutter collection quiver] - country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform] - device_info_plus 9.1.1 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - devicelocale 0.7.0 [flutter flutter_web_plugins] - dio 5.3.3 [async http_parser meta path] - dotted_border 2.1.0 [flutter path_drawing] - expandable 5.0.1 [flutter] - expandable_page_view 1.0.17 [flutter] - expandable_sliver_list 4.1.1 [flutter] - facebook_app_events 0.19.0 [flutter] - firebase_analytics 10.7.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_installations 0.2.4+4 [firebase_app_installations_platform_interface firebase_app_installations_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.14.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.22.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.4.4 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_dynamic_links 5.4.4 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_messaging 14.7.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_remote_config 4.3.4 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_app_badger 1.5.0 [flutter] - flutter_chat_ui 1.6.10 [diffutil_dart equatable flutter flutter_chat_types flutter_link_previewer flutter_parsed_text intl meta photo_view scroll_to_index url_launcher visibility_detector] - flutter_config_plus 1.1.1 [flutter plugin_platform_interface] - flutter_keyboard_visibility 5.4.1 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_linux flutter_keyboard_visibility_macos flutter_keyboard_visibility_web flutter_keyboard_visibility_windows flutter] - flutter_local_notifications 16.1.0 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_native_splash 2.3.6 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml ansicolor] - flutter_rating_bar 4.0.1 [flutter] - flutter_sim_country_code 0.1.2 [flutter] - flutter_stripe 9.5.0+1 [flutter meta stripe_android stripe_ios stripe_platform_interface] - flutter_svg 2.0.9 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - gap 3.0.1 [flutter] - geocoding 2.1.1 [flutter geocoding_platform_interface geocoding_android geocoding_ios] - geolocator 10.1.0 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows] - go_router 12.1.1 [collection flutter flutter_web_plugins logging meta] - google_maps_flutter 2.5.0 [flutter google_maps_flutter_android google_maps_flutter_ios google_maps_flutter_platform_interface google_maps_flutter_web] - google_maps_webservice 0.0.20-nullsafety.5 [http meta json_annotation] - hive 2.2.3 [meta crypto] - hive_flutter 1.1.0 [flutter hive path_provider path] - i18n_extension 9.0.2 [sprintf args equatable intl flutter] - iban 1.0.1 [mod97] - image_cropper 5.0.0 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 1.0.4 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - in_app_review 2.0.8 [flutter in_app_review_platform_interface] - jiffy 6.2.1 [intl] - logger 2.0.2+1 - lottie 2.7.0 [archive flutter path vector_math] - map_launcher 3.1.0 [flutter] - mask_text_input_formatter 2.6.0 [flutter] - mime 1.0.4 - move_to_background 1.0.2 [flutter] - octo_image 2.0.0 [flutter] - overlay_tutorial 3.0.0 [flutter collection async equatable] - package_info_plus 4.2.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - path_provider 2.1.1 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - percent_indicator 4.2.3 [flutter] - permission_handler 11.0.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - pin_code_fields 8.0.1 [flutter] - provider 6.1.1 [collection flutter nested] - rive 0.9.1 [collection flutter graphs http meta] - share 2.0.4 [meta mime flutter] - shared_preferences 2.2.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shimmer 3.0.0 [flutter] - sliding_up_panel 2.0.0+1 [flutter] - sliver_tools 0.2.12 [flutter] - smooth_page_indicator 1.1.0 [flutter] - socket_io_client 2.0.3+1 [logging socket_io_common js] - table_calendar 3.0.9 [flutter intl simple_gesture_detector] - timezone 0.9.2 [path] - upgrader 8.2.0 [flutter device_info_plus html http os_detect package_info_plus shared_preferences url_launcher version xml] - url_launcher 6.2.1 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 4.1.0 [crypto sprintf] - visibility_detector 0.4.0+2 [flutter] - webview_flutter 4.4.2 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] dev dependencies: - build_runner 2.4.6 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web] - hive_generator 2.0.1 [build source_gen hive analyzer source_helper] dependency overrides: - http 1.1.0 [async http_parser meta] transitive dependencies: - _fe_analyzer_shared 64.0.0 [meta] - _flutterfire_internals 1.3.12 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 6.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - ansicolor 2.0.2 - archive 3.4.9 [crypto path pointycastle] - args 2.4.2 - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.4.1 [analyzer async convert crypto glob logging meta package_config path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.4.1 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml] - build_runner_core 7.2.11 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.7.0 [built_collection collection fixnum meta] - cached_network_image_platform_interface 3.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.1.0 [cached_network_image_platform_interface flutter flutter_cache_manager] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - clock 1.1.1 - code_builder 4.8.0 [built_collection built_value collection matcher meta] - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - cross_file 0.3.3+6 [js meta] - crypto 3.0.3 [typed_data] - csslib 1.0.0 [source_span] - dart_style 2.3.3 [analyzer args path pub_semver source_span] - dbus 0.7.10 [args ffi meta xml] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - diffutil_dart 3.0.0 - equatable 2.0.5 [collection meta] - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - file 7.0.0 [meta path] - file_selector_linux 0.9.2+1 [cross_file file_selector_platform_interface flutter] - file_selector_macos 0.9.3+3 [cross_file file_selector_platform_interface flutter] - file_selector_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface] - file_selector_windows 0.9.3+1 [cross_file file_selector_platform_interface flutter] - firebase_analytics_platform_interface 3.8.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.5+7 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_app_installations_platform_interface 0.1.4+12 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_app_installations_web 0.1.3+12 [_flutterfire_internals firebase_app_installations_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 7.0.4 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.8.7 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.8.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.6.12 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.6+12 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.5.13 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.5.13 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_remote_config_platform_interface 1.4.12 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.4.12 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - fixnum 1.1.0 - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_chat_types 3.6.2 [equatable json_annotation meta] - flutter_keyboard_visibility_linux 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_macos 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_keyboard_visibility_windows 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_link_previewer 3.2.2 [flutter flutter_chat_types flutter_linkify html http linkify meta url_launcher] - flutter_linkify 6.0.0 [flutter linkify] - flutter_local_notifications_linux 4.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories] - flutter_local_notifications_platform_interface 7.0.0+1 [flutter plugin_platform_interface] - flutter_parsed_text 2.2.1 [flutter] - flutter_plugin_android_lifecycle 2.0.17 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - freezed_annotation 2.4.1 [collection json_annotation meta] - frontend_server_client 3.2.0 [async path] - geocoding_android 2.1.2 [flutter geocoding_platform_interface] - geocoding_ios 2.1.1 [flutter geocoding_platform_interface] - geocoding_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - geolocator_android 4.4.0 [flutter geolocator_platform_interface uuid] - geolocator_apple 2.3.2 [flutter geolocator_platform_interface] - geolocator_platform_interface 4.2.0 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.2.0 [flutter flutter_web_plugins geolocator_platform_interface] - geolocator_windows 0.2.2 [flutter geolocator_platform_interface] - glob 2.1.2 [async collection file path string_scanner] - google_maps 6.3.0 [js js_wrapping meta] - google_maps_flutter_android 2.5.3 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface stream_transform] - google_maps_flutter_ios 2.3.2 [flutter google_maps_flutter_platform_interface stream_transform] - google_maps_flutter_platform_interface 2.4.1 [collection flutter plugin_platform_interface stream_transform] - google_maps_flutter_web 0.5.4+2 [collection flutter flutter_web_plugins google_maps google_maps_flutter_platform_interface sanitize_html stream_transform] - graphs 2.3.1 [collection] - html 0.15.4 [csslib source_span] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.1.3 [archive meta xml] - image_cropper_for_web 3.0.0 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 5.0.0 [flutter plugin_platform_interface http] - image_picker_android 0.8.8+2 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.1 [flutter flutter_web_plugins image_picker_platform_interface mime] - image_picker_ios 0.8.8+4 [flutter image_picker_platform_interface] - image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_macos 0.2.1+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_platform_interface 2.9.1 [cross_file flutter http plugin_platform_interface] - image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface] - in_app_review_platform_interface 2.0.5 [flutter url_launcher plugin_platform_interface platform] - intl 0.18.1 [clock meta path] - io 1.0.4 [meta path string_scanner] - js 0.6.7 [meta] - js_wrapping 0.7.4 [js] - json_annotation 4.8.1 [meta] - linkify 5.0.0 - logging 1.2.0 - matcher 0.12.16 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.5.0 [collection] - meta 1.9.1 - mod97 1.0.0 - modal_bottom_sheet 2.1.2 [flutter] - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - os_detect 2.0.1 - package_config 2.1.0 [path] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.3 - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.1 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.1 [flutter path_provider_platform_interface] - path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.1 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32] - pausable_timer 2.0.0+1 [clock] - permission_handler_android 11.1.0 [flutter permission_handler_platform_interface] - permission_handler_apple 9.1.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.12.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.3 [flutter permission_handler_platform_interface] - petitparser 5.4.0 [meta] - photo_view 0.14.0 [flutter] - platform 3.1.3 - plugin_platform_interface 2.1.7 [meta] - pointycastle 3.7.3 [collection convert js] - pool 1.5.1 [async stack_trace] - pub_semver 2.1.4 [collection meta] - pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml] - quiver 3.2.1 [matcher] - rxdart 0.27.7 - sanitize_html 2.1.0 [html meta] - scroll_to_index 3.0.1 [flutter] - shared_preferences_android 2.2.1 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.3.4 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.3.1 [flutter plugin_platform_interface] - shared_preferences_web 2.2.1 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.1 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel] - simple_gesture_detector 0.2.0 [flutter] - sky_engine 0.0.99 - socket_io_common 2.0.3 [logging] - source_gen 1.4.0 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.4 [analyzer collection source_gen] - source_span 1.10.0 [collection path term_glyph] - sprintf 7.0.0 - sqflite 2.3.0 [flutter sqflite_common path] - sqflite_common 2.5.0+2 [synchronized path meta] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - stripe_android 9.5.0+1 [flutter] - stripe_ios 9.5.0+1 [flutter] - stripe_platform_interface 9.5.0+1 [flutter freezed_annotation json_annotation meta plugin_platform_interface] - synchronized 3.1.0 - term_glyph 1.2.1 - test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - timing 1.0.1 [json_annotation] - typed_data 1.3.2 [collection] - universal_io 2.2.2 [collection meta typed_data] - universal_platform 1.0.0+1 - url_launcher_android 6.2.0 [flutter url_launcher_platform_interface] - url_launcher_ios 6.2.1 [flutter url_launcher_platform_interface] - url_launcher_linux 3.1.0 [flutter url_launcher_platform_interface] - url_launcher_macos 3.1.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.2.0 [flutter plugin_platform_interface] - url_launcher_web 2.2.0 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.1.0 [flutter url_launcher_platform_interface] - vector_graphics 1.1.9+1 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.9+1 - vector_graphics_compiler 1.1.9+1 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - version 3.0.2 - watcher 1.1.0 [async path] - web 0.1.4-beta - web_socket_channel 2.4.0 [async crypto stream_channel] - webview_flutter_android 3.12.1 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 2.7.0 [flutter meta plugin_platform_interface] - webview_flutter_wkwebview 3.9.4 [flutter path webview_flutter_platform_interface] - win32 5.1.0 [ffi] - win32_registry 1.1.2 [ffi win32] - xdg_directories 1.0.3 [meta path] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

danagbemava-nc commented 9 months ago

Hi @juleshyacinthe, can you try increasing the timeout value to see if that helps?

juleshyacinthe commented 9 months ago

Hi, I've tried increasing the timeout value up to 2 minutes, but it doesn't help.

danagbemava-nc commented 9 months ago

Hi @juleshyacinthe, do you get this issue for specific numbers or specific regions?

juleshyacinthe commented 9 months ago

Hi, According to Crashlytics, we have ~400 customers that encountered the issue over the last 7 days across iOS and Android. I don't think I can get the specific phone numbers, but most of them are phone numbers from Belgium / France for sure.

For some additional information, most of our user base uses iOS devices, yet the numbers for this specific issue are about the same on both OSes on Crashlytics.

danagbemava-nc commented 9 months ago

Hi @juleshyacinthe, can you try reaching out to firebase support? This seems like it might be an issue with the firebase backend considering some users are able to verify their codes successfully.

google-oss-bot commented 8 months ago

Hey @juleshyacinthe. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

juleshyacinthe commented 8 months ago

Hey, looks like the issue was that the auto verification wasn't triggering further login actions in our code. Commenting out the auto verification actions fixed the issue for now. Any idea what could have caused this to suddenly change?

danagbemava-nc commented 8 months ago

Hi @juleshyacinthe, I'm not entirely sure. Could you share what the auto verification code looks like?

juleshyacinthe commented 8 months ago

Sure, here's the code:

firebaseAuth.PhoneVerificationCompleted verificationCompleted = (firebaseAuth.PhoneAuthCredential phoneAuthCredential) async {
      await _auth.signInWithCredential(phoneAuthCredential);
      Logger.logInfo("Phone number automatically verified and user signed in: ${_auth.currentUser?.uid}");
      if (!completer.isCompleted) completer.complete(true);
    };

Here after the completer is complete, an auth provider would get the user from Firebase auth and sign in, but something stopped working at some point. The automatic validation is not critical in my implementation though so commenting out this part is perfectly fine by me. I think the actual issue comes from our provider not triggering the sign in action correctly.

danagbemava-nc commented 8 months ago

@juleshyacinthe, I'm not sure I follow, which provider are you referring to?

juleshyacinthe commented 8 months ago

Sorry, I'm using provider for state management, including authentication state.

danagbemava-nc commented 8 months ago

Oh, I see. Is there anything for us to do here? It seems like this has been resolved in your code

juleshyacinthe commented 8 months ago

Hey, I think everything's solved. Thanks for the help! :)