firebase / FirebaseUI-Flutter

Apache License 2.0
93 stars 81 forks source link

πŸ› Relogging before verifying your email causes the app example to crash. #115

Closed callmephil closed 9 months ago

callmephil commented 9 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?

Android, iOS, Web, macOS, Linux, Windows

List of dependencies used.

flutter pub deps -s list
Dart SDK 3.1.2
Flutter SDK 3.13.5
flutter_boost 1.0.0+1

dependencies:
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - vector_math 2.1.4
  - web 0.1.4-beta
  - sky_engine any
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.18.1
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - path 1.8.3
  - vector_math 2.1.4
  - web 0.1.4-beta
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - vector_math 2.1.4
  - web 0.1.4-beta
- email_validator 2.1.17
- firebase_auth 4.10.0
  - firebase_auth_platform_interface ^6.19.0
  - firebase_auth_web ^5.8.1
  - firebase_core ^2.16.0
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- firebase_core 2.16.0
  - firebase_core_platform_interface ^4.8.0
  - firebase_core_web ^2.8.0
  - flutter any
  - meta ^1.8.0
- firebase_dynamic_links 5.3.6
  - firebase_core ^2.16.0
  - firebase_core_platform_interface ^4.8.0
  - firebase_dynamic_links_platform_interface ^0.2.6+6
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_localizations 1.6.1
  - flutter any
  - flutter_localizations any
  - path ^1.8.2
- firebase_ui_oauth 1.4.11
  - desktop_webview_auth ^0.0.13
  - firebase_auth ^4.9.0
  - firebase_ui_auth ^1.8.0
  - firebase_ui_shared ^1.3.1
  - flutter_svg ^2.0.7
  - flutter any
- firebase_ui_shared 1.3.1
  - flutter any
- firebase_ui_oauth_apple 1.2.11
  - firebase_auth ^4.9.0
  - firebase_ui_oauth ^1.4.11
  - flutter any
- firebase_ui_oauth_facebook 1.2.11
  - firebase_auth ^4.9.0
  - firebase_ui_oauth ^1.4.11
  - flutter any
  - flutter_facebook_auth ^6.0.1
- firebase_ui_oauth_google 1.2.11
  - firebase_auth ^4.9.0
  - firebase_ui_oauth ^1.4.11
  - flutter any
  - google_sign_in ^6.1.0
- firebase_ui_oauth_twitter 1.2.11
  - flutter any
  - firebase_auth ^4.9.0
  - firebase_ui_oauth ^1.4.11
  - twitter_login ^4.3.2
- firebase_ui_auth 1.8.0
  - email_validator ^2.1.17
  - firebase_auth ^4.9.0
  - firebase_core ^2.15.1
  - firebase_dynamic_links ^5.3.4
  - firebase_ui_localizations ^1.6.1
  - firebase_ui_oauth ^1.4.11
  - firebase_ui_shared ^1.3.1
  - flutter any
  - flutter_localizations any
- go_router 11.0.0
  - collection ^1.15.0
  - flutter any
  - flutter_web_plugins any
  - logging ^1.0.0
  - meta ^1.7.0
- riverpod 2.4.0
  - meta ^1.9.0
  - stack_trace ^1.10.0
  - state_notifier >=0.7.2 <2.0.0
- flutter_riverpod 2.4.0
  - collection ^1.15.0
  - flutter any
  - meta ^1.4.0
  - riverpod 2.4.0
  - state_notifier >=0.7.2 <2.0.0

dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.6.0
  - matcher 0.12.16
  - path 1.8.3
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.0
  - vector_math 2.1.4
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - source_span 1.10.0
  - stream_channel 2.1.1
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - web 0.1.4-beta
- flutter_lints 2.0.3
  - lints ^2.0.0
- mockito 5.4.2
  - analyzer >=5.11.0 <6.0.0
  - build >=1.3.0 <3.0.0
  - code_builder ^4.5.0
  - collection ^1.15.0
  - dart_style >=1.3.6 <3.0.0
  - matcher ^0.12.15
  - meta ^1.3.0
  - path ^1.8.0
  - source_gen >=0.9.6 <2.0.0
  - test_api >=0.2.1 <0.7.0

transitive dependencies:
- _fe_analyzer_shared 61.0.0
  - meta ^1.0.2
- _flutterfire_internals 1.3.6
  - collection ^1.0.0
  - firebase_core ^2.16.0
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- analyzer 5.13.0
  - _fe_analyzer_shared ^61.0.0
  - collection ^1.17.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - meta ^1.7.0
  - package_config ^2.0.0
  - path ^1.8.0
  - pub_semver ^2.0.0
  - source_span ^1.8.0
  - watcher ^1.0.0
  - yaml ^3.0.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
- build 2.4.1
  - analyzer >=1.5.0 <7.0.0
  - async ^2.5.0
  - convert ^3.0.0
  - crypto ^3.0.0
  - glob ^2.0.0
  - logging ^1.0.0
  - meta ^1.3.0
  - package_config ^2.1.0
  - path ^1.8.0
- built_collection 5.1.1
- built_value 8.6.3
  - built_collection ^5.0.0
  - collection ^1.15.0
  - fixnum ^1.0.0
  - meta ^1.3.0
- characters 1.3.0
- clock 1.1.1
- code_builder 4.6.0
  - built_collection ^5.0.0
  - built_value ^8.0.0
  - collection ^1.15.0
  - matcher ^0.12.10
  - meta ^1.3.0
- collection 1.17.2
- convert 3.1.1
  - typed_data ^1.3.0
- crypto 3.0.3
  - typed_data ^1.3.0
- dart_style 2.3.2
  - analyzer >=5.12.0 <7.0.0
  - args >=1.0.0 <3.0.0
  - path ^1.0.0
  - pub_semver >=1.4.4 <3.0.0
  - source_span ^1.4.0
- desktop_webview_auth 0.0.13
  - crypto ^3.0.3
  - flutter any
  - http ^1.0.0
  - flutter_web_plugins any
  - plugin_platform_interface ^2.1.4
- facebook_auth_desktop 1.0.1
  - flutter any
  - http ^1.0.0
  - flutter_secure_storage ^9.0.0
  - flutter_facebook_auth_platform_interface ^5.0.0
- 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 6.19.0
  - _flutterfire_internals ^1.3.6
  - collection ^1.16.0
  - firebase_core ^2.16.0
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.8.1
  - firebase_auth_platform_interface ^6.19.0
  - firebase_core ^2.16.0
  - firebase_core_web ^2.8.0
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - js ^0.6.3
  - meta ^1.8.0
- firebase_core_platform_interface 4.8.0
  - collection ^1.0.0
  - flutter any
  - flutter_test any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_core_web 2.8.0
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - meta ^1.8.0
- firebase_dynamic_links_platform_interface 0.2.6+6
  - _flutterfire_internals ^1.3.6
  - firebase_core ^2.16.0
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- fixnum 1.1.0
- flutter_facebook_auth 6.0.2
  - flutter any
  - flutter_facebook_auth_platform_interface ^5.0.0
  - flutter_facebook_auth_web ^5.0.0
  - facebook_auth_desktop ^1.0.1
- flutter_facebook_auth_platform_interface 5.0.0
  - flutter any
  - plugin_platform_interface ^2.1.4
- flutter_facebook_auth_web 5.0.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - flutter_facebook_auth_platform_interface ^5.0.0
- flutter_secure_storage 9.0.0
  - flutter any
  - flutter_secure_storage_linux ^1.1.3
  - flutter_secure_storage_macos ^3.0.0
  - flutter_secure_storage_platform_interface ^1.0.1
  - flutter_secure_storage_web ^1.1.1
  - flutter_secure_storage_windows ^3.0.0
  - meta ^1.3.0
- flutter_secure_storage_linux 1.2.0
  - flutter any
  - flutter_secure_storage_platform_interface ^1.0.1
- flutter_secure_storage_macos 3.0.1
  - flutter any
  - flutter_secure_storage_platform_interface ^1.0.1
- flutter_secure_storage_platform_interface 1.0.2
  - flutter any
  - plugin_platform_interface ^2.0.1
- flutter_secure_storage_web 1.1.2
  - flutter any
  - flutter_secure_storage_platform_interface ^1.0.1
  - flutter_web_plugins any
  - js ^0.6.3
- flutter_secure_storage_windows 3.0.0
  - ffi ^2.0.0
  - flutter any
  - flutter_secure_storage_platform_interface ^1.0.1
  - path ^1.8.0
  - path_provider ^2.0.0
  - win32 ^5.0.0
- flutter_svg 2.0.7
  - flutter any
  - vector_graphics ^1.1.7
  - vector_graphics_codec ^1.1.7
  - vector_graphics_compiler ^1.1.7
- glob 2.1.2
  - async ^2.5.0
  - collection ^1.15.0
  - file >=6.1.3 <8.0.0
  - path ^1.8.0
  - string_scanner ^1.1.0
- google_identity_services_web 0.2.1+1
  - js ^0.6.4
  - meta ^1.3.0
- google_sign_in 6.1.5
  - flutter any
  - google_sign_in_android ^6.1.0
  - google_sign_in_ios ^5.5.0
  - google_sign_in_platform_interface ^2.4.0
  - google_sign_in_web ^0.12.0
- google_sign_in_android 6.1.19
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_ios 5.6.4
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
  - pigeon ^11.0.1
- google_sign_in_platform_interface 2.4.2
  - flutter any
  - plugin_platform_interface ^2.1.0
  - quiver ^3.0.0
- google_sign_in_web 0.12.0+5
  - flutter any
  - flutter_web_plugins any
  - google_identity_services_web ^0.2.1
  - google_sign_in_platform_interface ^2.4.0
  - http >=0.13.0 <2.0.0
  - js ^0.6.3
- http 1.1.0
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
- http_parser 4.0.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0
  - typed_data ^1.3.0
- intl 0.18.1
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.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.9.1
- package_config 2.1.0
  - path ^1.8.0
- path 1.8.3
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- path_provider 2.1.1
  - flutter any
  - path_provider_android ^2.1.0
  - path_provider_foundation ^2.3.0
  - path_provider_linux ^2.2.0
  - path_provider_platform_interface ^2.1.0
  - path_provider_windows ^2.2.0
- path_provider_android 2.2.0
  - flutter any
  - path_provider_platform_interface ^2.1.0
- path_provider_foundation 2.3.1
  - flutter any
  - path_provider_platform_interface ^2.1.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.1
  - flutter any
  - platform ^3.0.0
  - plugin_platform_interface ^2.1.0
- 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
- pigeon 11.0.1
  - analyzer ^5.13.0
  - args ^2.1.0
  - collection ^1.15.0
  - meta ^1.7.0
  - path ^1.8.0
  - yaml ^3.1.1
- platform 3.1.2
- plugin_platform_interface 2.1.6
  - meta ^1.3.0
- pub_semver 2.1.4
  - collection ^1.15.0
  - meta ^1.3.0
- quiver 3.2.1
  - matcher ^0.12.10
- sky_engine 0.0.99
- source_gen 1.4.0
  - analyzer >=5.2.0 <7.0.0
  - async ^2.5.0
  - build ^2.1.0
  - dart_style ^2.0.0
  - glob ^2.0.0
  - path ^1.8.0
  - source_span ^1.8.0
  - yaml ^3.0.0
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- stack_trace 1.11.0
  - path ^1.8.0
- state_notifier 1.0.0
  - meta ^1.1.8
- stream_channel 2.1.1
  - async ^2.5.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- term_glyph 1.2.1
- test_api 0.6.0
  - 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
- twitter_login 4.4.2
  - crypto ^3.0.1
  - flutter any
  - http ^1.0.0
- typed_data 1.3.2
  - collection ^1.15.0
- vector_graphics 1.1.7
  - flutter any
  - vector_graphics_codec 1.1.7
- vector_graphics_codec 1.1.7
- vector_graphics_compiler 1.1.7
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.7
- vector_math 2.1.4
- watcher 1.1.0
  - async ^2.5.0
  - path ^1.8.0
- web 0.1.4-beta
- win32 5.0.8
  - ffi ^2.1.0
- xdg_directories 1.0.3
  - meta ^1.3.0
  - path ^1.8.0
- xml 6.3.0
  - collection ^1.17.0
  - meta ^1.9.0
  - petitparser ^5.4.0
- yaml 3.1.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0

Steps to reproduce

  1. Clone the repository example
  2. set up and run the application as is.
  3. Press the register link and use your email or a temp mail generator to register.
  4. Press the register button. you should be redirected to the verify-email route.
  5. Before verifying your email, press the back button or reload the app to get back to the initial route (/)
  6. Try to sign in by entering the email and password you registered with.
  7. Get redirected to the verify email page.

See the verify-email screen crash the app.

StackTrace:

Error: FirebaseError: Firebase: We have blocked all requests from this device due to unusual activity. Try again later. (auth/too-many-requests).
    at Object.createErrorWithStack (http://localhost:56876/dart_sdk.js:5415:12)
    at Error._throw (http://localhost:56876/dart_sdk.js:8564:18)
    at Error.throwWithStackTrace (http://localhost:56876/dart_sdk.js:8561:18)
    at async._AsyncCallbackEntry.new.callback (http://localhost:56876/dart_sdk.js:40357:18)
    at Object._microtaskLoop (http://localhost:56876/dart_sdk.js:40214:13)
    at _startMicrotaskLoop (http://localhost:56876/dart_sdk.js:40220:13)
    at http://localhost:56876/dart_sdk.js:35968:9

Expected Behavior

I expect the verify Verify email screen to behave as is and not crash.

Actual Behavior

Verifying your email crashes the app the second time you enter the screen.

Additional Information

flutter doctor -v results

[βœ“] Flutter (Channel stable, 3.13.5, on macOS 13.5.2 22G91 darwin-arm64, locale en-US)
    β€’ Flutter version 3.13.5 on channel stable at /Users/phil/fvm/versions/3.13.5
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 12fccda598 (3 days ago), 2023-09-19 13:56:11 -0700
    β€’ Engine revision bd986c5ed2
    β€’ Dart version 3.1.2
    β€’ DevTools version 2.25.0

[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    β€’ Android SDK at /Users/phil/Library/Android/sdk
    β€’ Platform android-33, build-tools 33.0.2
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 15.0)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 15A240d
    β€’ CocoaPods version 1.12.1

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2022.3)
    β€’ 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 17.0.6+0-17.0.6b829.9-10027231)

[βœ“] Android Studio (version 2022.3)
    β€’ Android Studio at /Users/phil/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 17.0.6+0-17.0.6b829.9-10027231)

[βœ“] IntelliJ IDEA Ultimate Edition (version 2023.2.1)
    β€’ IntelliJ at /Users/phil/Applications/IntelliJ IDEA Ultimate.app
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin version 231.9161.14

[βœ“] VS Code (version 1.82.2)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.72.0

[βœ“] Connected device (1 available)
    β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 117.0.5938.92

[βœ“] Network resources
    β€’ All expected network resources are available.

β€’ No issues found!

Visuals always work best in understanding issues faster, so I am providing you with a recording as well.

https://github.com/firebase/FirebaseUI-Flutter/assets/2213079/d93d3c91-c6df-4566-8c73-aa7b71363da0

lesnitsky commented 9 months ago

There's not much that could be done from the UI perspective. This is an expected behavior from Firebase Auth. The UI handles this error appropriately (showing error message on email verification screen).

callmephil commented 9 months ago

There's not much that could be done from the UI perspective. This is an expected behavior from Firebase Auth. The UI handles this error appropriately (showing error message on email verification screen).

Shouldn't we handle the error to prevent the crash?