Skip to content

Commit 65495cb

Browse files
authored
fix: sub user password (#5048)
1 parent 6c0b3d0 commit 65495cb

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/writeData/subscriptions/components/BrokerFormContent.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ const BrokerFormContent: FC<Props> = ({
6262
evt.preventDefault()
6363
})
6464
}, [])
65+
66+
useEffect(() => {
67+
if (formContent.brokerUsername) {
68+
setSecurity('user')
69+
}
70+
}, [])
6571
return (
6672
<Grid>
6773
<Grid.Row>
@@ -291,6 +297,8 @@ const BrokerFormContent: FC<Props> = ({
291297
{feature: 'subscriptions'}
292298
)
293299
setSecurity('none')
300+
formContent.brokerUsername = null
301+
formContent.brokerPassword = null
294302
}}
295303
value="none"
296304
titleText="None"

src/writeData/subscriptions/components/UserInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const UserInput: FC<Props> = ({formContent, updateForm, className, edit}) => (
5252
</Form.Element>
5353
<Form.Element label="Password">
5454
<Input
55-
type={InputType.Text}
55+
type={InputType.Password}
5656
placeholder="*********"
5757
name="password"
5858
value={formContent.brokerPassword}

src/writeData/subscriptions/utils/form.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ export const sanitizeForm = (form: Subscription): Subscription => {
124124
}
125125

126126
if (form.brokerPassword === '' || form.brokerUsername === '') {
127-
delete form.brokerUsername
128127
delete form.brokerPassword
129128
}
130129
return form

0 commit comments

Comments
 (0)