-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Bug report
Describe the bug
I implemented email link authentication which works fine and reliably in most cases. One of the working ones is:
- User enters its email address
- User receives the correct email with the login link
- User clicks on the link and gets back into the app via dynamic links
What's not working is if the user forwards the received mail in a Microsoft Mail Client such as Outlook. This causes the link to be altered from
https://appdev.page.link/?link=https://...
to
https://appdev.page.link/?link=https:/...
So as you can see the '/' gets removed by these clients. This was only reproducible on Microsoft Mail and Microsoft Outlook.
In my opinion a reason may be that the link query parameter is not correctly encoded.
Steps to reproduce
Steps to reproduce the behavior:
- Create a dynamic link
final parameters = DynamicLinkParameters(
uriPrefix: 'https://app.page.link',
link: Uri.parse('https://app.de/signUp'),
androidParameters: AndroidParameters(
packageName: 'de.app.dev',
minimumVersion: 100,
),
iosParameters: IosParameters(
bundleId: 'de.app.dev',
minimumVersion: '1.0.0',
),
);
final dynamicUrl = (await parameters.buildShortLink()).shortUrl;
- Create
ActionCodeSettings
final actionCodeSettings = ActionCodeSettings(
url: dynamicUrl.toString(),
handleCodeInApp: true,
iOSBundleId: 'de.app.dev',
androidPackageName: 'de.app.dev',
androidInstallApp: true,
androidMinimumVersion: '21',
);
- Get the email from the user
- Send it to Firebase
FirebaseAuth.instance.sendSignInLinkToEmail(
email: email,
actionCodeSettings: actionCodeSettings,
);
- Forward the received mail on Microsoft Outlook (no matter if Mac OS or Windows)
- See that the forwarded mail contains
?link=https:/instead of?link=https://
Expected behavior
Forwarding the mail shouldn't have any impact on the login link independently from the used mail client.
Sample code
Future<void> sendSignInLinkToEmail(String email) async {
final parameters = DynamicLinkParameters(
uriPrefix: 'https://app.page.link',
link: Uri.parse('https://app.de/signUp'),
androidParameters: AndroidParameters(
packageName: 'de.app.dev',
minimumVersion: 100,
),
iosParameters: IosParameters(
bundleId: 'de.app.dev',
minimumVersion: '1.0.0',
),
);
final dynamicUrl = (await parameters.buildShortLink()).shortUrl;
final actionCodeSettings = ActionCodeSettings(
url: dynamicUrl.toString(),
handleCodeInApp: true,
iOSBundleId: 'de.app.dev',
androidPackageName: 'de.app.dev',
androidInstallApp: true,
androidMinimumVersion: '21',
);
return await FirebaseAuth.instance.sendSignInLinkToEmail(
email: email,
actionCodeSettings: actionCodeSettings,
);
}
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, 2.5.3, on macOS 12.0.1 21A559 darwin-x64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Community Edition (version 2021.2.3)
[✓] VS Code (version 1.61.2)
[✓] Connected device (3 available)
Flutter dependencies
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
dependencies:
- adaptive_action_sheet 2.0.0 [flutter universal_io]
- android_intent 2.0.2 [flutter platform meta]
- app_review 2.1.1+1 [http package_info url_launcher flutter]
- app_settings 4.1.1 [flutter]
- app_tracking_transparency 2.0.2+1 [flutter]
- async 2.8.1 [collection meta]
- auto_size_text 3.0.0 [flutter]
- bloc 7.2.1 [meta]
- cloud_firestore 2.5.4 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- collection 1.15.0
- connectivity_plus 2.0.2 [flutter meta connectivity_plus_platform_interface connectivity_plus_linux connectivity_plus_macos connectivity_plus_web connectivity_plus_windows]
- device_info_plus 3.1.0 [flutter device_info_plus_platform_interface device_info_plus_linux device_info_plus_macos device_info_plus_web device_info_plus_windows]
- easy_localization 3.0.0 [flutter shared_preferences intl args path easy_logger flutter_localizations]
- equatable 2.0.3 [collection meta]
- feature_discovery 0.14.0 [flutter provider shared_preferences]
- fimber 0.6.1
- firebase_analytics 8.3.4 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta]
- firebase_auth 3.1.4 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.8.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 2.2.4 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_dynamic_links 2.0.11 [firebase_core flutter]
- firebase_messaging 10.0.9 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_remote_config 0.11.0+2 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface flutter]
- firebase_storage 10.0.6 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_bloc 7.1.0 [flutter bloc provider]
- flutter_local_notifications 9.0.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_rating_bar 4.0.0 [flutter]
- flutter_secure_storage 4.2.1 [meta flutter]
- flutter_svg 0.23.0+1 [flutter meta path_drawing vector_math xml]
- flutter_time_picker_spinner 2.0.0 [flutter]
- flutter_tts 3.2.2 [flutter flutter_web_plugins]
- flutter_typeahead 3.2.1 [flutter flutter_keyboard_visibility]
- font_awesome_flutter 9.2.0 [flutter]
- geoflutterfire 3.0.1 [flutter cloud_firestore rxdart]
- geolocator 7.7.1 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web]
- google_maps_flutter 2.0.11 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface]
- google_maps_webservice 0.0.20-nullsafety.5 [http meta json_annotation]
- grouped_list 4.1.0 [flutter]
- here_sdk 4.9.2 [ffi intl meta url_launcher flutter flutter_localizations]
- http 0.13.4 [async http_parser meta path]
- image_cropper 1.4.1 [flutter]
- image_picker 0.8.4+3 [flutter flutter_plugin_android_lifecycle image_picker_for_web image_picker_platform_interface]
- intl 0.17.0 [clock path]
- intl_phone_number_input 0.7.0+2 [flutter meta libphonenumber_plugin equatable collection]
- json_annotation 4.3.0 [meta]
- kt_dart 0.10.0 [meta]
- map_launcher 2.1.1 [flutter]
- network_image_to_byte 0.0.1 [flutter]
- package_info 2.0.2 [flutter]
- permission_handler 8.2.5 [flutter meta permission_handler_platform_interface]
- pull_to_refresh 2.0.0 [flutter]
- rxdart 0.27.2
- shared_preferences 2.0.8 [flutter meta shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- table_calendar 3.0.3 [flutter intl simple_gesture_detector]
- url_launcher 6.0.12 [flutter meta url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- vrpay_flutter 0.0.40 [flutter]
- wakelock 0.5.6 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows]
dev dependencies:
- analyzer 2.7.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- bloc_test 8.3.0 [bloc meta mocktail test]
- build_runner 2.1.4 [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]
- build_verify 2.0.0 [path test]
- effective_dart 1.3.2
- firebase_auth_mocks 0.8.1 [flutter firebase_auth meta equatable]
- flutter_launcher_icons 0.9.2 [args image path yaml]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- json_serializable 6.0.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- mockito 5.0.16 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api]
transitive dependencies:
- _fe_analyzer_shared 30.0.0 [meta]
- archive 3.1.2 [crypto path]
- args 2.2.0
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.1.0 [analyzer async convert crypto glob logging meta path]
- build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.0.0 [built_collection built_value http_multi_server logging pedantic path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.4 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.2 [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.0
- built_value 8.1.1 [built_collection collection fixnum meta]
- characters 1.1.0
- charcode 1.3.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cli_util 0.3.3 [meta path]
- clock 1.1.0
- cloud_firestore_platform_interface 5.4.3 [collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 2.4.4 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 4.0.0 [built_collection built_value collection matcher meta]
- connectivity_plus_linux 1.1.0 [flutter connectivity_plus_platform_interface dbus meta nm]
- connectivity_plus_macos 1.2.1 [connectivity_plus_platform_interface flutter]
- connectivity_plus_platform_interface 1.1.0 [flutter meta plugin_platform_interface]
- connectivity_plus_web 1.1.0+1 [connectivity_plus_platform_interface flutter_web_plugins flutter]
- connectivity_plus_windows 1.2.0 [connectivity_plus_platform_interface flutter]
- convert 3.0.1 [typed_data]
- coverage 1.0.3 [args logging package_config path source_maps stack_trace vm_service]
- cross_file 0.3.1+4 [flutter meta]
- crypto 3.0.1 [collection typed_data]
- dart_style 2.0.2 [analyzer args path pub_semver source_span]
- dbus 0.5.4 [args meta pedantic xml]
- device_info_plus_linux 2.1.0 [device_info_plus_platform_interface file flutter meta]
- device_info_plus_macos 2.2.0 [device_info_plus_platform_interface flutter]
- device_info_plus_platform_interface 2.2.0 [flutter meta plugin_platform_interface]
- device_info_plus_web 2.1.0 [device_info_plus_platform_interface flutter_web_plugins flutter]
- device_info_plus_windows 2.1.0 [device_info_plus_platform_interface ffi flutter win32]
- easy_logger 0.0.2 [flutter]
- fake_async 1.2.0 [clock collection]
- ffi 1.0.0
- file 6.1.2 [meta path]
- firebase 9.0.1 [http http_parser js]
- firebase_analytics_platform_interface 2.0.1 [flutter meta]
- firebase_analytics_web 0.3.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta]
- firebase_auth_platform_interface 6.1.2 [firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 3.1.3 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.1.4 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 3.0.7 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.0.7 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- firebase_remote_config_platform_interface 0.3.0+7 [firebase_core flutter meta plugin_platform_interface]
- firebase_storage_platform_interface 4.0.4 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.0.4 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]
- fixnum 1.0.0
- flutter_keyboard_visibility 5.0.2 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_web 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_local_notifications_linux 0.3.0 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories]
- flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface]
- flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math]
- flutter_plugin_android_lifecycle 2.0.2 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- frontend_server_client 2.1.0 [async path]
- geolocator_android 2.1.0 [flutter geolocator_platform_interface]
- geolocator_apple 1.2.1 [flutter geolocator_platform_interface]
- geolocator_platform_interface 2.3.6 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.0.5 [flutter flutter_web_plugins geolocator_platform_interface]
- glob 2.0.1 [async collection file path pedantic string_scanner]
- google_maps_flutter_platform_interface 2.1.3 [collection flutter meta plugin_platform_interface stream_transform]
- graphs 2.0.0
- http_multi_server 3.0.1 [async]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- image 3.0.2 [archive meta xml]
- image_picker_for_web 2.1.0 [flutter flutter_web_plugins image_picker_platform_interface meta]
- image_picker_platform_interface 2.4.1 [flutter http meta plugin_platform_interface cross_file]
- io 1.0.3 [meta path string_scanner]
- js 0.6.3
- libphonenumber 2.0.2 [flutter meta]
- libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface]
- libphonenumber_plugin 0.2.3 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web libphonenumber]
- libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface]
- logging 1.0.1
- matcher 0.12.10 [stack_trace]
- meta 1.7.0
- mime 1.0.0
- mocktail 0.1.4 [collection matcher test]
- nested 1.0.0 [flutter]
- nm 0.3.0 [dbus]
- node_preamble 2.0.1
- package_config 2.0.0 [path]
- path 1.8.0
- path_drawing 0.5.1 [vector_math meta path_parsing flutter]
- path_parsing 0.2.1 [vector_math meta]
- path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.1 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.11.1
- permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
- petitparser 4.1.0 [meta]
- platform 3.0.0
- plugin_platform_interface 2.0.1 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.2.1 [file path platform]
- provider 5.0.0 [collection flutter nested]
- pub_semver 2.0.0 [collection]
- pubspec_parse 1.0.0 [checked_yaml collection json_annotation pub_semver yaml]
- shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows]
- shelf 1.2.0 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.0 [path shelf shelf_static]
- shelf_static 1.1.0 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel]
- simple_gesture_detector 0.2.0 [flutter]
- sky_engine 0.0.99
- source_gen 1.0.3 [analyzer async build dart_style glob meta path pedantic source_span yaml]
- source_helper 1.3.0 [analyzer collection source_gen]
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- source_span 1.8.1 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- term_glyph 1.2.0
- test 1.17.10 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pedantic pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core]
- test_api 0.4.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.4.0 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pedantic pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api]
- timezone 0.8.0 [path]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.0 [collection]
- universal_io 2.0.4 [collection crypto meta typed_data]
- url_launcher_linux 2.0.0 [flutter]
- url_launcher_macos 2.0.0 [flutter]
- url_launcher_platform_interface 2.0.4 [flutter plugin_platform_interface]
- url_launcher_web 2.0.1 [flutter flutter_web_plugins meta url_launcher_platform_interface]
- url_launcher_windows 2.0.0 [flutter]
- vector_math 2.1.0
- vm_service 6.2.0
- wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface]
- wakelock_platform_interface 0.3.0 [flutter meta]
- wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface]
- wakelock_windows 0.2.0 [flutter wakelock_platform_interface win32]
- watcher 1.0.0 [async path pedantic]
- web_socket_channel 2.1.0 [async crypto stream_channel]
- webkit_inspection_protocol 1.0.0 [logging]
- win32 2.2.5 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 5.1.2 [collection meta petitparser]
- yaml 3.1.0 [collection source_span string_scanner]