diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 50e05cde5..13e589d87 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -455,10 +455,14 @@ Future loginDialog() async { resp.user, resp.secret, isEmailVerification); } else { setState(() => isInProgress = false); + // Workaround for web, close the dialog first, then show the verification code dialog. + // Otherwise, the text field will keep selecting the text and we can't input the code. + // Not sure why this happens. + if (isWeb && close != null) close(null); final res = await verificationCodeDialog( resp.user, resp.secret, isEmailVerification); if (res == true) { - if (close != null) close(false); + if (!isWeb && close != null) close(false); return; } } diff --git a/flutter/lib/web/bridge.dart b/flutter/lib/web/bridge.dart index a00250171..0ec3e076f 100644 --- a/flutter/lib/web/bridge.dart +++ b/flutter/lib/web/bridge.dart @@ -1530,15 +1530,20 @@ class RustdeskImpl { Future mainAccountAuth( {required String op, required bool rememberMe, dynamic hint}) { - throw UnimplementedError("mainAccountAuth"); + return Future(() => js.context.callMethod('setByName', [ + 'account_auth', + jsonEncode({'op': op, 'remember': rememberMe}) + ])); } Future mainAccountAuthCancel({dynamic hint}) { - throw UnimplementedError("mainAccountAuthCancel"); + return Future( + () => js.context.callMethod('setByName', ['account_auth_cancel'])); } Future mainAccountAuthResult({dynamic hint}) { - throw UnimplementedError("mainAccountAuthResult"); + return Future( + () => js.context.callMethod('getByName', ['account_auth_result'])); } Future mainOnMainWindowClose({dynamic hint}) {