fix(users): edit profile username not lowercase (#2279)

This commit is contained in:
Meier Lukas authored and GitHub committed 2025-02-09 19:09:48 +01:00
1 parent 749b0c6ee9
commit b7fd2470ee
3 files changed
+6 -7

No files matched your search

+2 -1
View File
@@ -7,7 +7,8 @@ import type { TranslationObject } from "@homarr/translation";
import { zodEnumFromArray } from "./enums";
import { createCustomErrorParams } from "./form/i18n";
const usernameSchema = z.string().min(3).max(255);
// We always want the lowercase version of the username to compare it in a case-insensitive way
const usernameSchema = z.string().trim().toLowerCase().min(3).max(255);
const regexCheck = (regex: RegExp) => (value: string) => regex.test(value);
export const passwordRequirements = [