MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / isAnonymousAccessEnabled

Function isAnonymousAccessEnabled

packages/web/src/lib/entitlements.ts:44–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44export const isAnonymousAccessEnabled = async () => {
45 if (!await isAnonymousAccessAvailable()) {
46 return false;
47 }
48
49 if (env.FORCE_ENABLE_ANONYMOUS_ACCESS !== undefined) {
50 return env.FORCE_ENABLE_ANONYMOUS_ACCESS === 'true';
51 }
52
53 const org = await __unsafePrisma.org.findUnique({
54 where: { id: SINGLE_TENANT_ORG_ID },
55 });
56
57 if (!org) {
58 return false;
59 }
60
61 return org.isAnonymousAccessEnabled;
62}
63
64export const isValidLicenseActive = async () => {
65 const license = await getSingleTenantLicense();

Callers 6

withOptionalAuthFunction · 0.90
LayoutFunction · 0.90
page.tsxFile · 0.90
SignupFunction · 0.90
LoginFunction · 0.90

Calls 1

Tested by

no test coverage detected