CHORE: change random username to be <Adj><Animal><3*[0-9]>
This commit is contained in:
parent
22d4d7120d
commit
c082cae156
1 changed files with 7 additions and 6 deletions
|
|
@ -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,13 +25,14 @@ 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()
|
||||
const email = `${username}@demo.local`
|
||||
return { username, password, email }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue