Add Feature to Set Default User ID Email Address in Settings

Description:

I would like to request a feature that allows users to set a default email address for the User ID field when creating new password entries. This feature should be configurable through the application settings. When set, this email address would automatically populate the User ID field in the new entry form, enhancing user convenience and efficiency.

Use Case:

  • Efficiency: Users who frequently use the same email address for their logins will save time by not having to repeatedly enter the same information.
  • Consistency: Helps maintain consistency in the entries by reducing the chance of typographical errors in the email field.

Proposed Implementation:

  1. Settings Configuration:

    • Add a new setting in the application settings where users can specify their default User ID email address.
  2. ViewModel Modification:

    • Modify the ViewModel handling new entries to read from the settings and use the default email address if specified.
  3. UI Update:

    • Update the new entry form to automatically populate the User ID field with the default email address from the settings.

Example Configuration File:

A JSON configuration file to store the default email setting could look like this:

{
  "defaultEmail": "[email protected]"
}

Example Code Changes:

  1. ViewModel Code:

    public class AddEditItemViewModel : BaseViewModel
    {
        private string _userId;
        private const string SettingsFilePath = "path/to/settings.json"; // Adjust the path as necessary
    
        public AddEditItemViewModel()
        {
            // Load settings
            var settings = JObject.Parse(File.ReadAllText(SettingsFilePath));
            var defaultEmail = settings["defaultEmail"]?.ToString() ?? string.Empty;
    
            // Initialize properties
            _userId = defaultEmail;
        }
    
        // Property for UserID
        public string UserId
        {
            get => _userId;
            set => SetProperty(ref _userId, value);
        }
    
        // Other properties and methods
    }
    
  2. Settings UI Code:

    <TextBox Text="{Binding DefaultEmail}" PlaceholderText="Default User ID Email" />
    
  3. Settings ViewModel Code:

    public class SettingsViewModel : BaseViewModel
    {
        private string _defaultEmail;
        private const string SettingsFilePath = "path/to/settings.json";
    
        public SettingsViewModel()
        {
            // Load settings
            var settings = JObject.Parse(File.ReadAllText(SettingsFilePath));
            _defaultEmail = settings["defaultEmail"]?.ToString() ?? string.Empty;
        }
    
        public string DefaultEmail
        {
            get => _defaultEmail;
            set
            {
                SetProperty(ref _defaultEmail, value);
                // Save to settings file
                var settings = JObject.Parse(File.ReadAllText(SettingsFilePath));
                settings["defaultEmail"] = value;
                File.WriteAllText(SettingsFilePath, settings.ToString());
            }
        }
    
        // Other properties and methods
    }
    

Benefits:

  • Improves user experience by reducing repetitive data entry.
  • Ensures consistency across password entries.
  • Saves time for users with multiple logins.

Conclusion:

This feature would greatly enhance the usability and efficiency of the Bitwarden application. I believe it would be a valuable addition to the community and I hope the community will consider implementing it.

Thank you for considering this feature request!

A post was merged into an existing topic: Autocomplete default username (+random password) when creating new entries (or option in generator)