CHORE: change random username to be <Adj><Animal><3*[0-9]>

This commit is contained in:
padreug 2025-09-04 11:27:16 +02:00
parent 22d4d7120d
commit c082cae156

View file

@ -1,5 +1,5 @@
import { ref } from 'vue'
import { uniqueNamesGenerator, names, colors, animals } from 'unique-names-generator'
import { uniqueNamesGenerator, NumberDictionary, adjectives, animals } from 'unique-names-generator'
export interface GeneratedCredentials {
username: string
@ -25,11 +25,12 @@ export function useDemoAccountGenerator() {
// Generate unique username and random password
function generateCredentials(): GeneratedCredentials {
// Use only 2 dictionaries to keep username shorter
const numberDictionary = NumberDictionary.generate({ min: 100, max: 999 });
const username = uniqueNamesGenerator({
dictionaries: [names, colors],
separator: '_',
length: 2,
style: 'lowerCase'
dictionaries: [adjectives, animals, numberDictionary],
separator: '',
length: 3,
style: 'capital'
})
const password = generateRandomPassword()