-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Description
I have noticed that this plugin does not work correctly on the Safari browser. During the login flow the code stops at the saveCredentials function, which never resolves and does not throw any error, causing the awaited call to hang and leaving users stuck on the login page. However after refreshing the page the user is logged in successfully, which suggests that the token is fetched and stored but the login flow is blocked by this function. Is this a known Safari limitation, is there a recommended workaround or fix, or is it possible to disable this plugin conditionally for Safari only?
Code:
class SaveCredentialsUseCase {
const SaveCredentialsUseCase({
this.credentialsSaver = AutologinPlugin.saveCredentials,
});
final Future<bool> Function(Credential) credentialsSaver;
Future<Result> execute({
required String email,
required String password,
}) async {
try {
final isSuccess = await credentialsSaver(
Credential(
username: email,
password: password,
domain: '...',
),
);
if (!isSuccess) return Failure(Exception("Couldn't save credentials"));
return const Success(unit);
} on Exception catch (e) {
return Failure(Exception("Couldn't save credentials - $e"));
}
}
}
Steps to Reproduce
- Launch the Flutter app on the Web and make sure to choose Safari browser.
- Try to call the
AutologinPlugin.saveCredentialsfunction and make sure to await it. - The code is stuck on this function.
Affected Platform
Web,Safari
Flutter Version
Flutter 3.38.5
Plugin Version
autologin: ^1.0.1
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.38.5, on macOS 26.1 25B78 darwin-arm64, locale en-US) [790ms]
• Flutter version 3.38.5 on channel stable at /Users/bartozo/fvm/versions/3.38.5
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f6ff1529fd (4 weeks ago), 2025-12-11 11:50:07 -0500
• Engine revision 1527ae0ec5
• Dart version 3.10.4
• DevTools version 2.51.1
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
omit-legacy-version-file, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [2.5s]
• Android SDK at /Users/bartozo/Library/Android/sdk
• Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
• Platform android-36, build-tools 36.1.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.7+-13880790-b1038.58)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [2.7s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17C52
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [5ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (4 available) [9.1s]
• iPhone (Bartozo) (mobile) • 00008130-0018392C02E8001C • ios • iOS 26.1 23B85
• iPhone 16e (mobile) • 9BE2F574-1666-42E8-975F-E13C22C6A7FA • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.1 25B78 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 143.0.7499.170
[✓] Network resources [1,166ms]
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels