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.72k stars 3.97k forks source link

πŸ› [firebase_auth ^4.4.2] Login with firebase is persistent even if I uninstall the app on iOS #10912

Closed ousvat closed 1 year ago

ousvat commented 1 year ago

Bug report

Describe the bug Login with Firebase is persistent even if I uninstall the app.

Steps to reproduce

Steps to reproduce the behavior:

  1. Login with FirebaseAuth.instance.signInAnonymously()
  2. Uninstall the app and reinstall it.
  3. Check FirebaseAuth.instance.currentUser. It will not be null

Expected behavior

I was expected to need to log in again if I reinstall the app.

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [βœ“] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E261 darwin-arm64, locale en-RO) β€’ Flutter version 3.7.12 on channel stable at /Users/ovidiuusvat/development/flutter β€’ Upstream repository https://github.com/flutter/flutter.git β€’ Framework revision 4d9e56e694 (2 weeks ago), 2023-04-17 21:47:46 -0400 β€’ Engine revision 1a65d409c7 β€’ Dart version 2.19.6 β€’ DevTools version 2.20.1 [βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.1) β€’ Android SDK at /Users/ovidiuusvat/Library/Android/sdk β€’ Platform android-33, build-tools 33.0.1 β€’ Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java β€’ Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) β€’ All Android licenses accepted. [βœ“] Xcode - develop for iOS and macOS (Xcode 14.3) β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ Build 14E222b β€’ CocoaPods version 1.11.3 [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [βœ“] Android Studio (version 2022.1) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) [βœ“] VS Code (version 1.77.1) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.62.0 [βœ“] Connected device (5 available) β€’ FIG LX1 (mobile) β€’ HBEDU18B09006925 β€’ android-arm64 β€’ Android 9 (API 28) β€’ iPhone 14 Pro (mobile) β€’ 9446B5F2-647A-4762-8B92-711D83391FD5 β€’ ios β€’ com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator) β€’ iPhone 14 Pro Max (mobile) β€’ DC5FC756-51B5-4C13-9025-422395991772 β€’ ios β€’ com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator) β€’ macOS (desktop) β€’ macos β€’ darwin-arm64 β€’ macOS 13.3.1 22E261 darwin-arm64 β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 109.0.5414.119 [βœ“] HTTP Host Availability β€’ All required HTTP hosts are available ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 2.19.6 Flutter SDK 3.7.12 iplanto 1.0.0+1 dependencies: - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - cloud_firestore 4.5.3 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - collection 1.17.0 - cupertino_icons 1.0.5 - dartz 0.10.1 - drift 2.5.0 [async convert collection js meta stream_channel sqlite3] - drift_local_storage_inspector 0.5.0 [drift flutter storage_inspector] - equatable 2.0.5 [collection meta] - file_local_storage_inspector 0.3.1 [flutter path storage_inspector uuid] - firebase_analytics 10.2.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.4.2 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.10.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.1.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_storage 11.1.1 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_bloc 8.1.1 [flutter bloc provider] - flutter_easyloading 3.0.5 [flutter flutter_spinkit] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] - flutter_slidable 2.0.0 [flutter] - flutter_styled_toast 2.1.3 [flutter flutter_localizations] - flutter_svg 1.1.6 [flutter meta path_drawing vector_math xml] - fluttericon 2.0.0 [flutter] - freezed 2.3.2 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation] - freezed_annotation 2.2.0 [collection json_annotation meta] - get_it 7.2.0 [async collection] - google_fonts 4.0.3 [flutter http path_provider crypto] - google_sign_in 6.1.0 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - googleapis 9.2.0 [_discoveryapis_commons http] - im_stepper 1.0.1+1 [flutter] - image_picker 0.8.6+1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - injectable 2.1.0 [get_it] - intl 0.17.0 [clock path] - json_annotation 4.8.0 [meta] - json_serializable 6.6.0 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - lottie 2.2.0 [archive flutter path vector_math] - path 1.8.2 - path_provider 2.0.12 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - sizer 2.0.15 [universal_io flutter] - storage_inspector 0.3.0 [async dart_service_announcement flutter synchronized tuple uri uuid] - table_calendar 3.0.8 [flutter intl simple_gesture_detector] dev dependencies: - build_runner 2.3.3 [args async analyzer 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] - drift_dev 2.5.1 [charcode collection recase meta path json_annotation stream_transform args logging cli_util yaml io drift sqlite3 sqlparser analyzer analyzer_plugin source_span package_config pub_semver build build_resolvers build_config dart_style source_gen string_scanner] - flutter_launcher_icons 0.11.0 [args checked_yaml cli_util image json_annotation path yaml] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - injectable_generator 2.1.3 [build source_gen path glob analyzer code_builder dart_style injectable collection recase] transitive dependencies: - _discoveryapis_commons 1.0.5 [http http_parser meta] - _fe_analyzer_shared 52.0.0 [meta] - _flutterfire_internals 1.1.1 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.4.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - analyzer_plugin 0.11.2 [analyzer collection dart_style pub_semver yaml] - archive 3.3.6 [crypto path pointycastle] - args 2.3.2 - async 2.10.0 [collection meta] - bloc 8.1.0 [meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.3.1 [analyzer async convert crypto glob logging meta path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.1.0 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.4.3 [built_collection collection fixnum meta] - cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface] - characters 1.2.1 - charcode 1.3.1 - checked_yaml 2.0.2 [json_annotation source_span yaml] - cli_util 0.3.5 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 5.12.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 3.4.2 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - code_builder 4.4.0 [built_collection built_value collection matcher meta] - convert 3.1.1 [typed_data] - cross_file 0.3.3+2 [js meta] - crypto 3.0.2 [typed_data] - dart_service_announcement 1.2.3 [logging synchronized] - dart_style 2.2.4 [analyzer args path pub_semver source_span] - fake_async 1.3.1 [clock collection] - ffi 2.0.1 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.4.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.2 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.13.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.3.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.6.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.3.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.4.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_platform_interface 4.2.1 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.4.1 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - fixnum 1.1.0 - flutter_blurhash 0.7.0 [flutter] - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_plugin_android_lifecycle 2.0.7 [flutter] - flutter_spinkit 5.1.0 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 3.2.0 [async path] - glob 2.1.1 [async collection file path string_scanner] - google_identity_services_web 0.2.1 [js meta] - google_sign_in_android 6.1.5 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.5.1 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.4.0 [flutter plugin_platform_interface quiver] - google_sign_in_web 0.12.0 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js] - graphs 2.2.0 [collection] - http 0.13.5 [async http_parser meta path] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 3.3.0 [archive meta xml] - image_picker_android 0.8.5+5 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.10 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.6+6 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface] - io 1.0.4 [meta path string_scanner] - js 0.6.5 [meta] - logging 1.1.1 - matcher 0.12.13 [meta stack_trace] - material_color_utilities 0.2.0 - meta 1.8.0 - mime 1.0.4 - nested 1.0.0 [flutter] - octo_image 1.0.2 [flutter flutter_blurhash] - package_config 2.1.0 [path] - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.0.22 [flutter path_provider_platform_interface] - path_provider_foundation 2.1.1 [flutter path_provider_platform_interface] - path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.0.5 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.3 [ffi flutter path path_provider_platform_interface win32] - pedantic 1.11.1 - petitparser 5.1.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.3 [meta] - pointycastle 3.6.2 [collection convert js] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - provider 6.0.5 [collection flutter nested] - pub_semver 2.1.3 [collection meta] - pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml] - quiver 3.2.1 [matcher] - recase 4.1.0 - rxdart 0.27.7 - shelf 1.4.0 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel] - simple_gesture_detector 0.2.0 [flutter] - sky_engine 0.0.99 - source_gen 1.2.7 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.3 [analyzer collection source_gen] - source_span 1.9.1 [collection path term_glyph] - sqflite 2.2.4+1 [flutter sqflite_common path] - sqflite_common 2.4.2+2 [synchronized path meta] - sqlite3 1.9.1 [collection ffi js meta path] - sqlparser 0.27.0 [meta collection source_span charcode] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - synchronized 3.0.1 - term_glyph 1.2.1 - test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timing 1.0.1 [json_annotation] - tuple 2.0.1 - typed_data 1.3.1 [collection] - universal_io 2.0.4 [collection crypto meta typed_data] - uri 1.0.0 [matcher quiver] - uuid 3.0.7 [crypto] - vector_math 2.1.4 - watcher 1.0.2 [async path] - web_socket_channel 2.3.0 [async crypto stream_channel] - win32 3.1.3 [ffi] - xdg_directories 0.2.0+3 [meta path process] - xml 6.2.2 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner] ```

danagbemava-nc commented 1 year ago

Hi @ousvat, this is working as intended and is a behaviour of the native iOS SDK. The auth data is stored in keychain and is not cleared when you uninstall the app. There isn't a way to remove the data keychain when the app is uninstalled either so there isn't much action to take on that side either.

You can take advantage of the fact that preferences data is cleared on uninstall and then try to sign out the user on the first load of the app.

Closing as this is working as documented. See https://firebase.google.com/docs/auth/flutter/password-auth#sign_in_a_user_with_an_email_address_and_password for the documentation

Screenshot 2023-05-05 at 10 48 01

Thank you

ousvat commented 1 year ago

@danagbemava-nc thanks for making it clear to me