We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e55f66 commit 157ca00Copy full SHA for 157ca00
packages/web/src/app/[domain]/layout.tsx
@@ -46,7 +46,18 @@ export default async function Layout(props: LayoutProps) {
46
}
47
48
const session = await auth();
49
- const anonymousAccessEnabled = hasEntitlement("anonymous-access") && (await getAnonymousAccessStatus(domain));
+ 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
57
58
59
+ return status;
60
+ })();
61
62
// If the user is authenticated, we must check if they're a member of the org
63
if (session) {
0 commit comments