taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 0177b63221d2bae5d9dd47ec208d2c392173d166
parent 41f412168791ff02bcb4a55ec8ac3dfbbace6844
Author: Florian Dold <dold@taler.net>
Date:   Fri, 31 Jul 2026 15:45:05 +0200

ui: accept exactly the instance IDs the merchant accepts

The form allowed "@", which TALER_is_slug() rejects, and required two
characters, which it does not.

Diffstat:
Mpackages/taler-merchant-webui/src/utils/constants.ts | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/packages/taler-merchant-webui/src/utils/constants.ts b/packages/taler-merchant-webui/src/utils/constants.ts @@ -45,7 +45,12 @@ export const DEFAULT_REQUEST_TIMEOUT = 10; export const MAX_IMAGE_SIZE = 1024 * 1024; -export const INSTANCE_ID_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9_.@-]+$/; +// Must accept exactly what the backend's TALER_is_slug() accepts, or the form +// lets through IDs that POST /management/instances then rejects with a bare +// HTTP 400: ASCII alphanumerics plus "-", "_", "." and ":", at least one +// character, and neither "." nor "..". The ID is folded to lower case before +// it is sent, but upper case is accepted here so typing it is not a fight. +export const INSTANCE_ID_REGEX = /^(?!\.\.?$)[a-zA-Z0-9_.:-]+$/; export const EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; export const PHONE_JUST_NUMBERS_REGEX = /^\+[0-9 ]*$/;