Skip to content

Commit e0048d4

Browse files
committed
Generate random names for users
1 parent 387bd0a commit e0048d4

File tree

1 file changed

+56
-1
lines changed

1 file changed

+56
-1
lines changed

src/stores/auth.ts

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,68 @@ interface AuthState {
77

88
export const useAuthStore = create<AuthState>((/*set, get*/) => ({
99
user: {
10-
name: import.meta.env.VITE_AUTH_DISABLED_PROFILE_NAME,
10+
name: getRandomName(),
1111
nickname: import.meta.env.VITE_AUTH_DISABLED_NICKNAME,
1212
sub: import.meta.env.VITE_AUTH_DISABLED_SUB,
1313
},
1414
accessToken: import.meta.env.VITE_AUTH_DISABLED_ACCESS_TOKEN,
1515
}));
1616

17+
function getRandomName() {
18+
const NAMES = [
19+
'Alex',
20+
'Angel',
21+
'Arden',
22+
'Ari',
23+
'Aspen',
24+
'August',
25+
'Avery',
26+
'Baylor',
27+
'Billie',
28+
'Blair',
29+
'Blake',
30+
'Blake',
31+
'Cameron',
32+
'Casey',
33+
'Charlie',
34+
'Dakota',
35+
'Devon',
36+
'Drew',
37+
'Ellis',
38+
'Frankie',
39+
'Grey',
40+
'Harley',
41+
'Indigo',
42+
'Jamie',
43+
'Jesse',
44+
'Jordan',
45+
'Justice',
46+
'Kai',
47+
'London',
48+
'Micah',
49+
'Morgan',
50+
'Parker',
51+
'Phoenix',
52+
'Quinn',
53+
'Reese',
54+
'Remy',
55+
'Riley',
56+
'River',
57+
'Rowan',
58+
'Sage',
59+
'Sam',
60+
'Sasha',
61+
'Skyler',
62+
'Spencer',
63+
'Sydney',
64+
'Tatum',
65+
'Taylor',
66+
'Winter',
67+
];
68+
const randomIndex = Math.floor(Math.random() * NAMES.length);
69+
return NAMES[randomIndex];
70+
}
71+
1772
export type AuthenticatedUser = {
1873
name: string;
1974
nickname: string;

0 commit comments

Comments
 (0)