# 关于最大用户名长度的问题

**URL:** <https://meta.discourse.org/t/question-about-max-username-length/80022>\
**Category:** Product Support\
**Created:** [2018 年2 月 7 日 15:18 UTC](https://meta.discourse.org/t/question-about-max-username-length/80022 "2018-02-07T15:18:08Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

作者： ![Donavan\_Martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donavan_martin/32/198936_2.png) [@Donavan\_Martin](https://meta.discourse.org/u/Donavan_Martin)\
发布日期： [2020 年11 月 10 日 16:03 UTC](https://meta.discourse.org/t/question-about-max-username-length/80022/13 "2020-11-10T16:03:53Z")

</div>

看起来用户名最大长度限制为 60 个字符，即使设置得更大也是如此。

我尝试将用户名长度设置为 127 和 254……

端点：

- `https://{{url}}/admin/groups`
- 名称：`This_is_a_long_username_for_a_new_group_title_that_take_exactly_77_characters`

响应：

```plaintext
{
    "errors": [
        "Name is too long"
    ]
}

```

经核实，这与以下内容相关：

> <https://github.com/discourse/discourse/blob/e0d9232259f6fb0f76bca471c4626178665ca24a/app/models/username_validator.rb#L44>

---

_[View the full topic](https://meta.discourse.org/t/question-about-max-username-length/80022)._
