]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix username validation for special characters by URL-encoding user... 69298/head
authorAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Fri, 5 Jun 2026 07:07:38 +0000 (12:37 +0530)
committerAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Thu, 11 Jun 2026 05:09:57 +0000 (10:39 +0530)
When validating usernames, special characters such as '#' were not being URL-encoded before being appended to the user lookup endpoint.
Because the browser treats '#' as a URL fragment, the request path was truncated, causing the backend to return an incorrect response and the UI to display a misleading "User already exists" validation error.

Fixes: https://tracker.ceph.com/issues/77129
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts

index 95c80dd4665a039cc41e67e9c162b30d43a9650a..d432e318471c5c472451dd24dad79fb4a6d0316c 100644 (file)
@@ -21,7 +21,7 @@ export class UserService {
   }
 
   get(username: string) {
-    return this.http.get(`api/user/${username}`);
+    return this.http.get(`api/user/${encodeURIComponent(username)}`);
   }
 
   create(user: UserFormModel) {