Add moderator bots and editable MineGeo usernames
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 3m27s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 3m27s
This commit is contained in:
@@ -10,6 +10,7 @@ export const displayNameSchema = z
|
||||
(value) => !/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/u.test(value),
|
||||
"Use a single line without hidden control characters",
|
||||
);
|
||||
export const usernameSchema = z.string().trim().toLowerCase().regex(/^[a-z0-9_]{3,32}$/, "Use 3–32 letters, numbers or underscores.");
|
||||
export const newPasswordSchema = z
|
||||
.string()
|
||||
.min(12, "Use at least 12 characters")
|
||||
@@ -41,6 +42,7 @@ export const authActionSchema = z.discriminatedUnion("action", [
|
||||
export const profileUpdateSchema = z
|
||||
.object({
|
||||
displayName: displayNameSchema.optional(),
|
||||
username: usernameSchema.optional(),
|
||||
glowColor: glowColorSchema.optional(),
|
||||
avatarPath: z.string().max(128).nullable().optional(),
|
||||
})
|
||||
@@ -48,6 +50,7 @@ export const profileUpdateSchema = z
|
||||
.refine(
|
||||
(value) =>
|
||||
value.displayName !== undefined ||
|
||||
value.username !== undefined ||
|
||||
value.glowColor !== undefined ||
|
||||
value.avatarPath !== undefined,
|
||||
"Choose a profile change",
|
||||
@@ -81,5 +84,6 @@ export function authDestination(value: string | null | undefined): string {
|
||||
if (value && /^\/support\/[0-9a-f-]{36}$/i.test(value)) return value;
|
||||
if (value && /^\/tournaments\?map=[0-9a-f-]{36}$/i.test(value)) return value;
|
||||
if (value && /^\/pair\?code=[A-F0-9]{8}$/.test(value)) return value;
|
||||
if (value && /^\/moderator-application\/[a-f0-9]{64}$/.test(value)) return value;
|
||||
return "/dashboard";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user