mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 16:43:31 +00:00
The User model applies `validate:"max=12"` to the `Username` field, but the initial setup flow did not validate this constraint. This allowed creation of a root user with an overly long username (e.g. "Uselessly1344"), which later caused every update request to fail with: Field validation for 'Username' failed on the 'max' tag This patch adds an explicit length check in `controller/setup.go` to reject usernames longer than 12 characters during setup, keeping validation rules consistent across the entire application. Refs: #1214
3.8 KiB
3.8 KiB