From 1ed675fcf5a5b8041880fe3ab4167a9744f077d3 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Fri, 27 Feb 2026 18:25:38 +0100 Subject: [PATCH] Replace hardcoded password words with Random Word API Improve password generator by using dynamic word sources instead of static hardcoded lists. Changes: - Created useRandomWords composable: - Primary: Random Word API (https://random-word-api.herokuapp.com) - Fallback: EFF Diceware word list (576 memorable words) - Automatic fallback if API fails or is unavailable - Updated PasswordGenerator component: - Remove 80+ lines of hardcoded word lists (adjectives, nouns, verbs, objects) - Use async getRandomWords() for passphrase generation - Better word variety and unpredictability - Maintains same UX (no visible changes to users) Benefits: - More secure: Larger word pool (thousands vs 80 words) - Always fresh: API provides truly random words - Reliable: Built-in fallback ensures it always works - Maintainable: No need to curate word lists - Smaller bundle: Removed ~80 hardcoded words from component --- src/components/settings/PasswordGenerator.vue | 123 +-- src/composables/useRandomWords.ts | 741 ++++++++++++++++++ 2 files changed, 750 insertions(+), 114 deletions(-) create mode 100644 src/composables/useRandomWords.ts diff --git a/src/components/settings/PasswordGenerator.vue b/src/components/settings/PasswordGenerator.vue index 4778bc1..869624e 100644 --- a/src/components/settings/PasswordGenerator.vue +++ b/src/components/settings/PasswordGenerator.vue @@ -135,6 +135,7 @@