diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 1e9c16f21b..285c306510 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1097,13 +1097,12 @@ App::post('/v1/account/sessions/magic-url') $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM)); } - if ($securityPhrase) { - // create two arrays of random words from the dictionary and pick one word from each array to generate a security phrase - $wordArray1 = array("apple","banana","cat","dog","elephant","fish","guitar","hat","ice cream","jacket","kangaroo","lemon","moon","notebook","orange","piano","quilt","rabbit","sun","tree","umbrella","violin","watermelon","xylophone","yogurt","zebra","airplane","ball","cloud","diamond","eagle","fire","giraffe","hammer","island","jellyfish","kiwi","lamp","mango","needle","ocean","pear","quasar","rose","star","turtle","unicorn","volcano","whale","xylograph","yarn","zephyr","ant","book","candle","door","envelope","feather","globe","harp","insect","jar","kite","lighthouse","magnet","necklace","owl","puzzle","queen","rainbow","sailboat","telescope","umbrella","vase","wallet","xylograph","yacht","zeppelin","accordion","brush","chocolate","dolphin","easel","fountain","globe","hairbrush","iceberg","jigsaw","kettle","leopard","marble","nutmeg","obstacle","penguin","quiver","raccoon","sphinx","trampoline","utensil","velvet","wagon","xerox","yodel","zipper"); - $wordArray2 = array("abundant", "adaptable", "adventurous", "affectionate", "agile", "amiable", "amazing", "ambitious", "amicable", "amusing", "astonishing", "attentive", "authentic", "awesome", "balanced", "beautiful", "bold", "brave", "bright", "bubbly", "calm", "capable", "charismatic", "charming", "cheerful", "clever", "colorful", "compassionate", "confident", "cooperative", "courageous", "courteous", "creative", "curious", "dazzling", "dedicated", "delightful", "determined", "diligent", "dynamic", "easygoing", "effervescent", "efficient", "elegant", "empathetic", "energetic", "enthusiastic", "exuberant", "faithful", "fantastic", "fearless", "flexible", "friendly", "fun-loving", "generous", "gentle", "genuine", "graceful", "gracious", "happy", "hardworking", "harmonious", "helpful", "honest", "hopeful", "humble", "imaginative", "impressive", "incredible", "inspiring", "intelligent", "joyful", "kind", "knowledgeable", "lively", "lovable", "lovely", "loyal", "majestic", "magnificent", "mindful", "modest", "passionate", "patient", "peaceful", "perseverant", "playful", "polite", "positive", "powerful", "practical", "precious", "proactive", "productive", "punctual", "quick-witted", "radiant", "reliable", "resilient", "resourceful", "respectful", "responsible", "sensitive", "serene", "sincere", "skillful", "soothing", "spirited", "splendid", "steadfast", "strong", "supportive", "sweet", "talented", "thankful", "thoughtful", "thriving", "tranquil", "trustworthy", "upbeat", "versatile", "vibrant", "vigilant", "warmhearted", "welcoming", "wholesome", "witty", "wonderful", "zealous"); - $securityPhraseString = $wordArray1[array_rand($wordArray1)] . " " . $wordArray2[array_rand($wordArray2)]; - $securityPhraseMessage = "


We have received a login attempt with the following phrase:
" . $securityPhraseString . "
"; - } + if ($securityPhrase) { + $wordArray1 = array("Abundant", "Adaptable", "Adventurous", "Affectionate", "Agile", "Amiable", "Amazing", "Ambitious", "Amicable", "Amusing", "Astonishing", "Attentive", "Authentic", "Awesome", "Balanced", "Beautiful", "Bold", "Brave", "Bright", "Bubbly", "Calm", "Capable", "Charismatic", "Charming", "Cheerful", "Clever", "Colorful", "Compassionate", "Confident", "Cooperative", "Courageous", "Courteous", "Creative", "Curious", "Dazzling", "Dedicated", "Delightful", "Determined", "Diligent", "Dynamic", "Easygoing", "Effervescent", "Efficient", "Elegant", "Empathetic", "Energetic", "Enthusiastic", "Exuberant", "Faithful", "Fantastic", "Fearless", "Flexible", "Friendly", "Fun-loving", "Generous", "Gentle", "Genuine", "Graceful", "Gracious", "Happy", "Hardworking", "Harmonious", "Helpful", "Honest", "Hopeful", "Humble", "Imaginative", "Impressive", "Incredible", "Inspiring", "Intelligent", "Joyful", "Kind", "Knowledgeable", "Lively", "Lovable", "Lovely", "Loyal", "Majestic", "Magnificent", "Mindful", "Modest", "Passionate", "Patient", "Peaceful", "Perseverant", "Playful", "Polite", "Positive", "Powerful", "Practical", "Precious", "Proactive", "Productive", "Punctual", "Quick-witted", "Radiant", "Reliable", "Resilient", "Resourceful", "Respectful", "Responsible", "Sensitive", "Serene", "Sincere", "Skillful", "Soothing", "Spirited", "Splendid", "Steadfast", "Strong", "Supportive", "Sweet", "Talented", "Thankful", "Thoughtful", "Thriving", "Tranquil", "Trustworthy", "Upbeat", "Versatile", "Vibrant", "Vigilant", "Warmhearted", "Welcoming", "Wholesome", "Witty", "Wonderful", "Zealous"); + $wordArray2 = array("apple", "banana", "cat", "dog", "elephant", "fish", "guitar", "hat", "ice cream", "jacket", "kangaroo", "lemon", "moon", "notebook", "orange", "piano", "quilt", "rabbit", "sun", "tree", "umbrella", "violin", "watermelon", "xylophone", "yogurt", "zebra", "airplane", "ball", "cloud", "diamond", "eagle", "fire", "giraffe", "hammer", "island", "jellyfish", "kiwi", "lamp", "mango", "needle", "ocean", "pear", "quasar", "rose", "star", "turtle", "unicorn", "volcano", "whale", "xylograph", "yarn", "zephyr", "ant", "book", "candle", "door", "envelope", "feather", "globe", "harp", "insect", "jar", "kite", "lighthouse", "magnet", "necklace", "owl", "puzzle", "queen", "rainbow", "sailboat", "telescope", "umbrella", "vase", "wallet", "xylograph", "yacht", "zeppelin", "accordion", "brush", "chocolate", "dolphin", "easel", "fountain", "globe", "hairbrush", "iceberg", "jigsaw", "kettle", "leopard", "marble", "nutmeg", "obstacle", "penguin", "quiver", "raccoon", "sphinx", "trampoline", "utensil", "velvet", "wagon", "xerox", "yodel", "zipper"); + $securityPhraseString = $wordArray1[array_rand($wordArray1)] . " " . $wordArray2[array_rand($wordArray2)]; + $securityPhraseMessage = "


We have received a login attempt with the following phrase:
" . $securityPhraseString . "
"; + } $token = new Document([ '$id' => ID::unique(),