From 56a37fc7aeec28a2d844ea74492232a4be50d69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Beno=C3=AEt=20Grimaldi?= Date: Sat, 7 Feb 2026 11:44:22 +0100 Subject: [PATCH] Fix wrong username regex --- frontend/src/entrypoints/templates.ts | 2 +- policies/register/register.rego | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/entrypoints/templates.ts b/frontend/src/entrypoints/templates.ts index 2e0cf93d2..77587ee58 100644 --- a/frontend/src/entrypoints/templates.ts +++ b/frontend/src/entrypoints/templates.ts @@ -10,7 +10,7 @@ // Ideally later on we could find a way to hydrate full React components instead // of doing this, as this can very quickly get out of hands. -const VALID_USERNAME_RE = /^\s*([a-z0-9.=_/-]+|@[a-z0-9.=_/-]+(:.*)?)\s*$/g; +const VALID_USERNAME_RE = /^\s*([a-z0-9.=_/+-]+|@[a-z0-9.=_/+-]+(:.*)?)\s*$/g; /** Grab the nearest error message inserted by the templates by error kind and code */ function grabErrorMessage( diff --git a/policies/register/register.rego b/policies/register/register.rego index 89002a075..93ef86a0d 100644 --- a/policies/register/register.rego +++ b/policies/register/register.rego @@ -49,7 +49,7 @@ violation contains { "field": "username", "code": "username-invalid-chars", "msg": "username contains invalid characters", } if { - not regex.match(`^[a-z0-9.=_/-]+$`, input.username) + not regex.match(`^[a-z0-9.=_/+-]+$`, input.username) } violation contains {