Skip to content

Commit c9574d5

Browse files
committed
fix(sso): hide the reveal toggle when there is nothing to reveal
1 parent 1329bc9 commit c9574d5

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

apps/sim/ee/sso/components/sso-settings.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -713,19 +713,26 @@ function OrganizationSsoSettings({ organizationId }: SSOProps) {
713713
inputClassName={!showClientSecret ? '[-webkit-text-security:disc]' : undefined}
714714
error={showErrors && errors.clientSecret.length > 0}
715715
endAdornment={
716-
<Button
717-
type='button'
718-
variant='ghost'
719-
onClick={() => setShowClientSecret((s) => !s)}
720-
className='size-6 p-0 text-[var(--text-muted)] hover:text-[var(--text-primary)]'
721-
aria-label={showClientSecret ? 'Hide client secret' : 'Show client secret'}
722-
>
723-
{showClientSecret ? (
724-
<EyeOff className='size-[14px]' />
725-
) : (
726-
<Eye className='size-[14px]' />
727-
)}
728-
</Button>
716+
// Only offer the reveal once there is something to reveal. The
717+
// stored secret is never sent to the browser, so on an untouched
718+
// edit the toggle would be a control that visibly does nothing.
719+
formData.clientSecret ? (
720+
<Button
721+
type='button'
722+
variant='ghost'
723+
onClick={() => setShowClientSecret((s) => !s)}
724+
className='size-6 p-0 text-[var(--text-muted)] hover:text-[var(--text-primary)]'
725+
aria-label={
726+
showClientSecret ? 'Hide client secret' : 'Show client secret'
727+
}
728+
>
729+
{showClientSecret ? (
730+
<EyeOff className='size-[14px]' />
731+
) : (
732+
<Eye className='size-[14px]' />
733+
)}
734+
</Button>
735+
) : undefined
729736
}
730737
/>
731738
</SettingRow>

0 commit comments

Comments
 (0)