vibetunnel/ios/VibeTunnel/Views/Connection
David Collado 8f20a0ef26 Implement auto-login functionality for iOS app
- Add AuthenticationError enum for proper error handling in authentication domain
- Add attemptAutoLogin(profile:) method to AuthenticationService that:
  - Checks for valid existing tokens first
  - Retrieves stored credentials from Keychain using profile ID
  - Attempts authentication with stored username/password
  - Throws AuthenticationError for graceful fallback to manual login

- Update ServerProfilesViewModel.connectToProfile() to:
  - Remove early return that immediately showed login modal
  - Attempt auto-login first when authentication required
  - Only show login modal when auto-login fails (graceful fallback)
  - Maintain existing connection flow for no-auth servers

- Enhance server setup UI to capture username during profile creation:
  - Add username field to ConnectionViewModel
  - Add username input to ServerConfigForm
  - Update profile creation to store actual username instead of hardcoded "admin"
  - Default to "admin" if username field is empty for backward compatibility

- Update EnhancedConnectionView to pass username binding to form
- Build verification: All changes compile successfully

This implements a "Terminus-like experience" where users configure credentials once during server setup and enjoy automatic authentication thereafter, with graceful fallback to manual login when needed.
2025-07-03 13:18:48 +01:00
..
ConnectionView.swift Implement auto-login functionality for iOS app 2025-07-03 13:18:48 +01:00
EnhancedConnectionView.swift Implement auto-login functionality for iOS app 2025-07-03 13:18:48 +01:00
LoginView.swift Split session view file (#89) 2025-06-26 21:15:07 +02:00
ServerConfigForm.swift Implement auto-login functionality for iOS app 2025-07-03 13:18:48 +01:00