From 63f32126240952936e4bb0cd4cdfff9ce957c3d9 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 6 Jun 2024 10:01:24 +0200 Subject: [PATCH] fix: trim sso URL fields (#7301) What the title says. There are input values that are whitespace sensitive, so this will trim clientId and entity field, preventing the form from sending leading or trailing whitespace. Will make a PR on enterprise as well to trim on the backend as well. --- .../src/component/admin/auth/OidcAuth/OidcAuth.tsx | 10 +++++++--- .../src/component/admin/auth/SamlAuth/SamlAuth.tsx | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx index d6cb4e64ac..de810d4afd 100644 --- a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx +++ b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx @@ -59,6 +59,10 @@ export const OidcAuth = () => { setValue(event.target.name, event.target.value); }; + const trimAndUpdateField = (event: React.ChangeEvent) => { + setValue(event.target.name, event.target.value.trim()); + }; + const updateEnabled = () => { setData({ ...data, enabled: !data.enabled }); }; @@ -146,7 +150,7 @@ export const OidcAuth = () => { { { { setValue(event.target.name, event.target.value); }; + const trimAndUpdateField = (event: React.ChangeEvent) => { + setValue(event.target.name, event.target.value.trim()); + }; + const updateEnabled = () => { setData({ ...data, enabled: !data.enabled }); }; @@ -137,7 +141,7 @@ export const SamlAuth = () => { { {