From 1bb0bdffb095412c088d3848f3fecbf95ff29886 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 11 Mar 2024 20:17:10 +0100 Subject: [PATCH] fix(server): config saving with layout that includes a dash (mart-e) (#5193) * [FIX] Accept layout with dash At least seht-drai and ergo-l is not compatible * add regex --------- Co-authored-by: Miodec --- backend/src/api/schemas/config-schema.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/api/schemas/config-schema.ts b/backend/src/api/schemas/config-schema.ts index 0b7e8aa0f..20471da69 100644 --- a/backend/src/api/schemas/config-schema.ts +++ b/backend/src/api/schemas/config-schema.ts @@ -77,7 +77,11 @@ const CONFIG_SCHEMA = joi.object({ keymapLegendStyle: joi .string() .valid("lowercase", "uppercase", "blank", "dynamic"), - keymapLayout: joi.string().valid().max(50).token(), + keymapLayout: joi + .string() + .regex(/[\w-_]+/) + .valid() + .max(50), keymapShowTopRow: joi.string().valid("always", "layout", "never"), fontFamily: joi .string()