mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
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.
This commit is contained in:
parent
eef1d2980c
commit
63f3212624
@ -59,6 +59,10 @@ export const OidcAuth = () => {
|
||||
setValue(event.target.name, event.target.value);
|
||||
};
|
||||
|
||||
const trimAndUpdateField = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(event.target.name, event.target.value.trim());
|
||||
};
|
||||
|
||||
const updateEnabled = () => {
|
||||
setData({ ...data, enabled: !data.enabled });
|
||||
};
|
||||
@ -146,7 +150,7 @@ export const OidcAuth = () => {
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<TextField
|
||||
onChange={updateField}
|
||||
onChange={trimAndUpdateField}
|
||||
label='Discover URL'
|
||||
name='discoverUrl'
|
||||
value={data.discoverUrl}
|
||||
@ -164,7 +168,7 @@ export const OidcAuth = () => {
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<TextField
|
||||
onChange={updateField}
|
||||
onChange={trimAndUpdateField}
|
||||
label='Client ID'
|
||||
name='clientId'
|
||||
value={data.clientId}
|
||||
@ -185,7 +189,7 @@ export const OidcAuth = () => {
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<TextField
|
||||
onChange={updateField}
|
||||
onChange={trimAndUpdateField}
|
||||
label='Client Secret'
|
||||
name='secret'
|
||||
value={data.secret}
|
||||
|
@ -54,6 +54,10 @@ export const SamlAuth = () => {
|
||||
setValue(event.target.name, event.target.value);
|
||||
};
|
||||
|
||||
const trimAndUpdateField = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(event.target.name, event.target.value.trim());
|
||||
};
|
||||
|
||||
const updateEnabled = () => {
|
||||
setData({ ...data, enabled: !data.enabled });
|
||||
};
|
||||
@ -137,7 +141,7 @@ export const SamlAuth = () => {
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<TextField
|
||||
onChange={updateField}
|
||||
onChange={trimAndUpdateField}
|
||||
label='Entity ID'
|
||||
name='entityId'
|
||||
value={data.entityId}
|
||||
@ -159,7 +163,7 @@ export const SamlAuth = () => {
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<TextField
|
||||
onChange={updateField}
|
||||
onChange={trimAndUpdateField}
|
||||
label='Single Sign-On URL'
|
||||
name='signOnUrl'
|
||||
value={data.signOnUrl}
|
||||
@ -213,7 +217,7 @@ export const SamlAuth = () => {
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<TextField
|
||||
onChange={updateField}
|
||||
onChange={trimAndUpdateField}
|
||||
label='Single Sign-out URL'
|
||||
name='signOutUrl'
|
||||
value={data.signOutUrl}
|
||||
|
Loading…
Reference in New Issue
Block a user