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

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

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 = [