Skip to content

Commit 157ca00

Browse files
feedback
1 parent 5e55f66 commit 157ca00

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/web/src/app/[domain]/layout.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,18 @@ export default async function Layout(props: LayoutProps) {
4646
}
4747

4848
const session = await auth();
49-
const anonymousAccessEnabled = hasEntitlement("anonymous-access") && (await getAnonymousAccessStatus(domain));
49+
const anonymousAccessEnabled = await (async () => {
50+
if (!hasEntitlement("anonymous-access")) {
51+
return false;
52+
}
53+
54+
const status = await getAnonymousAccessStatus(domain);
55+
if (isServiceError(status)) {
56+
return false;
57+
}
58+
59+
return status;
60+
})();
5061

5162
// If the user is authenticated, we must check if they're a member of the org
5263
if (session) {

0 commit comments

Comments
 (0)