feat: request approval (#16784)

* feat: add connections without sending passwords

Add Without password actions and pass the selection through desktop,
mobile and Web sessions. Omit the password when constructing LoginRequest,
preserve saved credentials, and reuse the existing approval and OS login
dialogs. Keep protocol and controlled-side authentication changes separate.

* fix: preserve login method across session windows

* fix: skip password persistence for consent connections

* refactor: unify request approval menus and naming

* chore: move request approval translation key to the end

* i18n: translate request approval menu label

* fix: align request approval menu layout and icons

* fix: avoid duplicate focus stops in request approval menus

* fix: distinguish request approval submenus on mobile

* fix: open overflowing submenus to the left

* Revert "fix: distinguish request approval submenus on mobile"

This reverts commit 7f0e50d4e4.
This commit is contained in:
21pages authored and GitHub committed 2026-11-02 23:48:27 +08:00
1 parent 037b8787fe
commit a85ad89ffc
89 files changed
+1110 -152

No files matched your search

@@ -16,11 +16,13 @@ class FileManagerPage extends StatefulWidget {
FileManagerPage(
{Key? key,
required this.id,
this.loginMethod = '',
this.password,
this.isSharedPassword,
this.forceRelay})
: super(key: key);
final String id;
final String loginMethod;
final String? password;
final bool? isSharedPassword;
final bool? forceRelay;
@@ -276,6 +278,7 @@ class _FileManagerPageState extends State<FileManagerPage> {
super.initState();
gFFI.start(widget.id,
isFileTransfer: true,
loginMethod: widget.loginMethod,
password: widget.password,
isSharedPassword: widget.isSharedPassword,
forceRelay: widget.forceRelay);
+5
View File
@@ -208,6 +208,7 @@ class WebHomePage extends StatelessWidget {
bool isTerminal = false;
String? id;
String? password;
var loginMethod = '';
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case '--connect':
@@ -240,6 +241,9 @@ class WebHomePage extends StatelessWidget {
password = args[i + 1];
i++;
break;
case '--request-approval':
loginMethod = 'request-approval';
break;
default:
break;
}
@@ -249,6 +253,7 @@ class WebHomePage extends StatelessWidget {
isFileTransfer: isFileTransfer,
isViewCamera: isViewCamera,
isTerminal: isTerminal,
loginMethod: loginMethod,
password: password);
}
}
@@ -71,12 +71,14 @@ class RemotePage extends StatefulWidget {
RemotePage(
{Key? key,
required this.id,
this.loginMethod = '',
this.password,
this.isSharedPassword,
this.forceRelay})
: super(key: key);
final String id;
final String loginMethod;
final String? password;
final bool? isSharedPassword;
final bool? forceRelay;
@@ -123,6 +125,7 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
gFFI.ffiModel.updateEventListener(sessionId, widget.id);
gFFI.start(
widget.id,
loginMethod: widget.loginMethod,
password: widget.password,
isSharedPassword: widget.isSharedPassword,
forceRelay: widget.forceRelay,
@@ -71,8 +71,10 @@ class TerminalPage extends StatefulWidget {
required this.isSharedPassword,
this.forceRelay,
this.connToken,
this.loginMethod = '',
}) : super(key: key);
final String id;
final String loginMethod;
final String? password;
final bool? forceRelay;
final bool? isSharedPassword;
@@ -141,6 +143,7 @@ class _TerminalPageState extends State<TerminalPage>
// Use shared FFI instance from connection manager
_ffi = TerminalConnectionManager.getConnection(
peerId: widget.id,
loginMethod: widget.loginMethod,
password: widget.password,
isSharedPassword: widget.isSharedPassword,
forceRelay: widget.forceRelay,
@@ -40,12 +40,14 @@ class ViewCameraPage extends StatefulWidget {
ViewCameraPage(
{Key? key,
required this.id,
this.loginMethod = '',
this.password,
this.isSharedPassword,
this.forceRelay})
: super(key: key);
final String id;
final String loginMethod;
final String? password;
final bool? isSharedPassword;
final bool? forceRelay;
@@ -90,6 +92,7 @@ class _ViewCameraPageState extends State<ViewCameraPage>
gFFI.start(
widget.id,
isViewCamera: true,
loginMethod: widget.loginMethod,
password: widget.password,
isSharedPassword: widget.isSharedPassword,
forceRelay: widget.forceRelay,