From 728e82276c4c7deb07819decf99925787e6122a6 Mon Sep 17 00:00:00 2001 From: Rishabh Negi Date: Sat, 14 Mar 2026 15:05:13 +0530 Subject: [PATCH] fix(api): add anchors to username validation regex --- packages/api/src/EmbeddedChatApi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/src/EmbeddedChatApi.ts b/packages/api/src/EmbeddedChatApi.ts index 72e25a046..9db4a6dfe 100644 --- a/packages/api/src/EmbeddedChatApi.ts +++ b/packages/api/src/EmbeddedChatApi.ts @@ -436,7 +436,7 @@ export default class EmbeddedChatApi { async updateUserUsername(userid: string, username: string) { const newUserName = username.replace(/\s/g, ".").toLowerCase(); - const usernameRegExp = /[0-9a-zA-Z-_.]+/; + const usernameRegExp = /^[0-9a-zA-Z-_.]+$/; if (usernameRegExp.test(newUserName)) { try {