Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Icon,
Link,
Tooltip,
Switch,
} from '@codesandbox/components';
import {
AuthType,
Expand Down Expand Up @@ -94,6 +95,9 @@ export const RegistryForm = ({
const [scopes, setScopes] = React.useState<string[]>(
registry?.enabledScopes || []
);
const [proxyEnabled, setProxyEnabled] = React.useState(
registry?.proxyEnabled
);

const addScope = () => {
setScopes(oldScopes => [...oldScopes, '']);
Expand All @@ -118,7 +122,7 @@ export const RegistryForm = ({
enabledScopes: scopes.filter(s => s !== ''),
registryAuthType: authenticationType,
registryUrl,
proxyEnabled: true,
proxyEnabled,
});

// We make sure to always show one input field
Expand Down Expand Up @@ -200,6 +204,26 @@ export const RegistryForm = ({
setAuthKey={setAuthKey}
disabled={disabled}
/>

<div>
<CustomFormField
direction="horizontal"
label="Use the server proxy to access registry"
>
<Switch
onChange={() => {
setProxyEnabled(s => !s);
}}
on={proxyEnabled}
disabled={disabled}
/>
</CustomFormField>
<Text size={3} variant="muted">
Disabling the proxy will allow you to use the registry behind
a VPN, but will expose the auth token to the browser and
require a CORS setup.
</Text>
</div>
</Stack>
<Stack
align="center"
Expand Down