Skip to content

Commit 72d4e72

Browse files
committed
fix(secrets): cross-browser masking and grid layout for non-admin users
1 parent 93b83ba commit 72d4e72

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/sim/app/workspace/[workspaceId]/settings/components/credentials/credentials-manager.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ function WorkspaceVariableRow({
152152
}: WorkspaceVariableRowProps) {
153153
const [valueFocused, setValueFocused] = useState(false)
154154

155-
const maskedValueStyle =
156-
canEdit && !valueFocused ? ({ WebkitTextSecurity: 'disc' } as React.CSSProperties) : undefined
157-
158155
return (
159156
<div className='contents'>
160157
<EmcnInput
@@ -177,6 +174,7 @@ function WorkspaceVariableRow({
177174
<div />
178175
<EmcnInput
179176
value={canEdit ? value : value ? '\u2022'.repeat(value.length) : ''}
177+
type={canEdit && !valueFocused ? 'password' : 'text'}
180178
onChange={(e) => onValueChange(envKey, e.target.value)}
181179
readOnly
182180
onFocus={(e) => {
@@ -188,11 +186,11 @@ function WorkspaceVariableRow({
188186
onBlur={() => {
189187
if (canEdit) setValueFocused(false)
190188
}}
189+
name={`workspace_env_value_${envKey}_${Math.random()}`}
191190
autoComplete='off'
192191
autoCorrect='off'
193192
autoCapitalize='off'
194193
spellCheck='false'
195-
style={maskedValueStyle}
196194
className='h-9'
197195
/>
198196
<Button
@@ -203,7 +201,7 @@ function WorkspaceVariableRow({
203201
>
204202
Details
205203
</Button>
206-
{canEdit && (
204+
{canEdit ? (
207205
<Tooltip.Root>
208206
<Tooltip.Trigger asChild>
209207
<Button variant='ghost' onClick={() => onDelete(envKey)} className='h-9 w-9'>
@@ -212,6 +210,8 @@ function WorkspaceVariableRow({
212210
</Tooltip.Trigger>
213211
<Tooltip.Content>Delete secret</Tooltip.Content>
214212
</Tooltip.Root>
213+
) : (
214+
<div />
215215
)}
216216
</div>
217217
)

0 commit comments

Comments
 (0)