Skip to content

Commit ffd03b5

Browse files
chore(web): hide anonymous access setting during onboarding
1 parent 7c9c670 commit ffd03b5

3 files changed

Lines changed: 25 additions & 18 deletions

File tree

docs/docs/configuration/auth/access-settings.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ sidebarTitle: Access settings
55

66
There are various settings to control how users access your Sourcebot deployment.
77

8-
# Anonymous access
9-
10-
<Note>Anonymous access cannot be enabled if you have an enterprise license. If you have any questions about this restriction [reach out to us](https://www.sourcebot.dev/contact).</Note>
11-
12-
By default, your Sourcebot deployment is gated with a login page. If you'd like users to access the deployment anonymously, you can enable anonymous access.
13-
14-
This can be enabled by navigating to **Settings -> Access** or by setting the `FORCE_ENABLE_ANONYMOUS_ACCESS` environment variable.
15-
16-
When accessing Sourcebot anonymously, a user's permissions are limited to that of the [Guest](/docs/configuration/auth/roles-and-permissions) role.
17-
188
# Member Approval
199

2010
By default, Sourcebot requires new members to be approved by an owner of the deployment. This section explains how approvals work and how
@@ -37,4 +27,15 @@ Owners can see and manage all pending join requests by navigating to **Settings
3727
If member approval is required, an owner of the deployment can enable an invite link. When enabled, users
3828
can use this invite link to register and be automatically added to the organization without approval:
3929

40-
![Invite Link Toggle](/images/invite_link_toggle.png)
30+
![Invite Link Toggle](/images/invite_link_toggle.png)
31+
32+
33+
# Anonymous access
34+
35+
<Note>Anonymous access is only available in the free plan. If you have any questions about this restriction [reach out to us](https://www.sourcebot.dev/contact).</Note>
36+
37+
By default, your Sourcebot deployment is gated with a login page. If you'd like users to access the deployment anonymously, you can enable anonymous access.
38+
39+
This can be enabled by navigating to **Settings -> Access** or by setting the `FORCE_ENABLE_ANONYMOUS_ACCESS` environment variable.
40+
41+
When accessing Sourcebot anonymously, a user's permissions are limited to that of the [Guest](/docs/configuration/auth/roles-and-permissions) role.

packages/web/src/app/components/organizationAccessSettings.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { __unsafePrisma } from "@/prisma"
66
import { env } from "@sourcebot/shared"
77
import { isAnonymousAccessAvailable, isAnonymousAccessEnabled } from "@/lib/entitlements"
88

9-
export async function OrganizationAccessSettings() {
9+
interface OrganizationAccessSettingsProps {
10+
showAnonymousAccessToggle?: boolean;
11+
}
12+
13+
export async function OrganizationAccessSettings({ showAnonymousAccessToggle = true }: OrganizationAccessSettingsProps = {}) {
1014
const org = await __unsafePrisma.org.findUnique({ where: { id: SINGLE_TENANT_ORG_ID } });
1115
if (!org) {
1216
return <div>Error loading organization</div>
@@ -23,11 +27,13 @@ export async function OrganizationAccessSettings() {
2327

2428
return (
2529
<div className="space-y-6">
26-
<AnonymousAccessToggle
27-
anonymousAccessAvailable={anonymousAccessAvailable}
28-
anonymousAccessEnabled={anonymousAccessEnabled}
29-
forceEnableAnonymousAccess={forceEnableAnonymousAccess}
30-
/>
30+
{showAnonymousAccessToggle && (
31+
<AnonymousAccessToggle
32+
anonymousAccessAvailable={anonymousAccessAvailable}
33+
anonymousAccessEnabled={anonymousAccessEnabled}
34+
forceEnableAnonymousAccess={forceEnableAnonymousAccess}
35+
/>
36+
)}
3137

3238
<OrganizationAccessSettingsWrapper
3339
memberApprovalRequired={org.memberApprovalRequired}

packages/web/src/app/onboard/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default async function Onboarding(props: OnboardingProps) {
133133
),
134134
component: (
135135
<div className="space-y-6">
136-
<OrganizationAccessSettings />
136+
<OrganizationAccessSettings showAnonymousAccessToggle={false} />
137137
<Button asChild className="w-full">
138138
<Link href={`/onboard?step=${steps.length + 1}`}>Continue →</Link>
139139
</Button>

0 commit comments

Comments
 (0)