[PR #2150] [MERGED] Move username sanitization to model and make it less strict #1782

Closed
opened 2026-02-04 20:14:55 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pelican-dev/panel/pull/2150
Author: @Boy132
Created: 1/29/2026
Status: Merged
Merged: 2/1/2026
Merged by: @Boy132

Base: mainHead: boy132/fix-username-sanitization


📝 Commits (1)

  • 4d67661 move username sanitization to model and make it less strict

📊 Changes

2 files changed (+2 additions, -7 deletions)

View changed files

📝 app/Models/User.php (+2 -1)
📝 app/Services/Users/UserCreationService.php (+0 -6)

📄 Description

Closes #2138

Before:
Backend silently removed . and - from username, made it lowercase and max length was 64.
Frontend did not check these restrictions.

Now:
Username is only made lowercase. (to allow case insensitive login) . and - are allowed. (will cause no problems with sftp)
Frontend and backend limits for max length match.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pelican-dev/panel/pull/2150 **Author:** [@Boy132](https://github.com/Boy132) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 2/1/2026 **Merged by:** [@Boy132](https://github.com/Boy132) **Base:** `main` ← **Head:** `boy132/fix-username-sanitization` --- ### 📝 Commits (1) - [`4d67661`](https://github.com/pelican-dev/panel/commit/4d6766134e5d13d6ff7c7bb51a911ea84b637bf6) move username sanitization to model and make it less strict ### 📊 Changes **2 files changed** (+2 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `app/Models/User.php` (+2 -1) 📝 `app/Services/Users/UserCreationService.php` (+0 -6) </details> ### 📄 Description Closes #2138 **Before:** Backend silently removed `.` and `-` from username, made it lowercase and max length was 64. Frontend did not check these restrictions. **Now:** Username is only made lowercase. (to allow case insensitive login) `.` and `-` are allowed. (will cause _no_ problems with sftp) Frontend and backend limits for max length match. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-04 20:14:55 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel#1782