fix: web, 2fa, trust (#9594)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-10-08 18:35:25 +08:00 committed by GitHub
parent 2591d4f044
commit 507de628c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,7 +152,10 @@ class RustdeskImpl {
required String code,
required bool trustThisDevice,
dynamic hint}) {
return Future(() => js.context.callMethod('setByName', ['send_2fa', code]));
return Future(() => js.context.callMethod('setByName', [
'send_2fa',
jsonEncode({'code': code, 'trust_this_device': trustThisDevice})
]));
}
Future<void> sessionClose({required UuidValue sessionId, dynamic hint}) {
@ -1682,7 +1685,8 @@ class RustdeskImpl {
bool sessionGetEnableTrustedDevices(
{required UuidValue sessionId, dynamic hint}) {
throw UnimplementedError();
return js.context.callMethod('getByName', ['enable_trusted_devices']) ==
'Y';
}
Future<String> mainGetTrustedDevices({dynamic hint}) {