From f245e55391f3b1a445d3cdd5c884fb8be2bba66d Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 6 Jun 2024 11:29:53 +0200 Subject: [PATCH] fix: trim sso URL fields (#7301) (#7303) 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 d6cb4e64ac7a..de810d4afd34 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 = () => { { {