🐛 Bug Report: Cannot set firstName and lastName to 2 character strings #429

Closed
opened 2025-10-08 00:08:18 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @enquestor on GitHub.

Reproduction steps

  1. Go to https://example.pocket-id.com/settings/admin/users
  2. Try setting firstName or lastName to 2 character strings

Expected behavior

Be able to save the firstName and lastName successfully.

Actual Behavior

Shows LastName must be at least 3 characters long error message.

Note that when I set lastName (or firstName) to a 1 character string, a red error message would appear under the textbox, however if I enter a 2 character string, the error message is a toast.

Thoughts / Others

I think any non-empty string should be allowed in firstName and lastName?

This validation also causes issues when using non-english characters such as Chinese or Japanese, since many Chinese/Japanese last names are single character.

Originally created by @enquestor on GitHub. ### Reproduction steps 1. Go to `https://example.pocket-id.com/settings/admin/users` 2. Try setting `firstName` or `lastName` to 2 character strings ### Expected behavior Be able to save the `firstName` and `lastName` successfully. ### Actual Behavior Shows `LastName must be at least 3 characters long` error message. Note that when I set `lastName` (or `firstName`) to a 1 character string, a red error message would appear under the textbox, however if I enter a 2 character string, the error message is a toast. ### Thoughts / Others I think any non-empty string should be allowed in `firstName` and `lastName`? This validation also causes issues when using non-english characters such as Chinese or Japanese, since many Chinese/Japanese last names are single character.
OVERLORD added the bug label 2025-10-08 00:08:18 +03:00
Author
Owner

@enquestor commented on GitHub:

Seems like these lines in UserCreateDto is the issue:

FirstName string `json:"firstName" binding:"required,min=3,max=30"`
LastName  string `json:"lastName" binding:"required,min=3,max=30"`

Should be an easy fix, but not sure if this is intended or not.

@enquestor commented on GitHub: Seems like these lines in `UserCreateDto` is the issue: ``` FirstName string `json:"firstName" binding:"required,min=3,max=30"` LastName string `json:"lastName" binding:"required,min=3,max=30"` ``` Should be an easy fix, but not sure if this is intended or not.
Author
Owner

@stonith404 commented on GitHub:

Thanks for reporting this. This should be fixed in v0.22.0.

@stonith404 commented on GitHub: Thanks for reporting this. This should be fixed in `v0.22.0`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#429