From 8cdce956e722aee3c3d5a2b1df110d809edfc8cc Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 28 Jul 2025 15:52:52 +0200 Subject: [PATCH] remove double block --- .../Settings/RemoteAccessSettingsView.swift | 101 ------------------ 1 file changed, 101 deletions(-) diff --git a/mac/VibeTunnel/Presentation/Views/Settings/RemoteAccessSettingsView.swift b/mac/VibeTunnel/Presentation/Views/Settings/RemoteAccessSettingsView.swift index e4c71947..5eb1e658 100644 --- a/mac/VibeTunnel/Presentation/Views/Settings/RemoteAccessSettingsView.swift +++ b/mac/VibeTunnel/Presentation/Views/Settings/RemoteAccessSettingsView.swift @@ -540,107 +540,6 @@ private struct ErrorView: View { } } -// MARK: - Authentication Section - -private struct AuthenticationSection: View { - @Binding var authMode: AuthenticationMode - @Binding var enableSSHKeys: Bool - let logger: Logger - let serverManager: ServerManager - - var body: some View { - Section { - VStack(alignment: .leading, spacing: 16) { - // Authentication mode picker - VStack(alignment: .leading, spacing: 8) { - HStack { - Text("Authentication Method") - .font(.callout) - Spacer() - Picker("", selection: $authMode) { - ForEach(AuthenticationMode.allCases, id: \.self) { mode in - Text(mode.displayName) - .tag(mode) - } - } - .labelsHidden() - .pickerStyle(.menu) - .frame(alignment: .trailing) - .onChange(of: authMode) { _, newValue in - // Save the authentication mode - UserDefaults.standard.set( - newValue.rawValue, - forKey: AppConstants.UserDefaultsKeys.authenticationMode - ) - - Task { - logger.info("Authentication mode changed to: \(newValue.rawValue)") - await serverManager.restart() - } - } - } - - Text(authMode.description) - .font(.caption) - .foregroundStyle(.secondary) - .fixedSize(horizontal: false, vertical: true) - .frame(maxWidth: .infinity, alignment: .leading) - } - - // Additional info based on selected mode - if authMode == .osAuth || authMode == .both { - HStack(alignment: .center, spacing: 6) { - Image(systemName: "info.circle") - .foregroundColor(.blue) - .font(.system(size: 12)) - .frame(width: 16, height: 16) - Text("Uses your macOS username: \(NSUserName())") - .font(.caption) - .foregroundStyle(.secondary) - Spacer() - } - } - - if authMode == .sshKeys || authMode == .both { - HStack(alignment: .center, spacing: 6) { - Image(systemName: "key.fill") - .foregroundColor(.blue) - .font(.system(size: 12)) - .frame(width: 16, height: 16) - Text("SSH keys from ~/.ssh/authorized_keys") - .font(.caption) - .foregroundStyle(.secondary) - Spacer() - Button("Open folder") { - let sshPath = NSHomeDirectory() + "/.ssh" - if FileManager.default.fileExists(atPath: sshPath) { - NSWorkspace.shared.open(URL(fileURLWithPath: sshPath)) - } else { - // Create .ssh directory if it doesn't exist - try? FileManager.default.createDirectory( - atPath: sshPath, - withIntermediateDirectories: true, - attributes: [.posixPermissions: 0o700] - ) - NSWorkspace.shared.open(URL(fileURLWithPath: sshPath)) - } - } - .buttonStyle(.link) - .font(.caption) - } - } - } - } header: { - Text("Authentication") - .font(.headline) - } footer: { - Text("Localhost connections are always accessible without authentication.") - .font(.caption) - .multilineTextAlignment(.center) - .frame(maxWidth: .infinity) - } - } -} // MARK: - Previews